*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --ink: #0d1b2a;
    --ocean: #1a6b8a;
    --gold: #c9a84c;
    --gold-light: #e8c96b;
    --sand: #f5ede0;
    --mist: rgba(255,255,255,0.07);
}

body {
    font-family: 'Raleway', sans-serif;
    background: var(--ink);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
}

/* Starfield */
.stars {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.star {
    position: absolute;
    background: white;
    border-radius: 50%;
    animation: twinkle var(--d, 3s) ease-in-out infinite var(--delay, 0s);
}

@keyframes twinkle {
    0%, 100% { opacity: var(--min-op, 0.2); }
    50%       { opacity: var(--max-op, 0.9); }
}

/* Ocean horizon background */
.horizon {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40%;
    background: linear-gradient(
            to top,
            #0a2240 0%,
            #0d3357 30%,
            #0f4270 55%,
            transparent 100%
    );
    z-index: 0;
}

/* Animated waves */
.wave {
    position: fixed;
    bottom: 0;
    left: -100%;
    width: 300%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.18;
}

.wave svg path {
    fill: #1a6b8a;
}

.wave-1 { animation: waveMove 14s linear infinite; bottom: 0; opacity: 0.15; }
.wave-2 { animation: waveMove 10s linear infinite reverse; bottom: 18px; opacity: 0.10; }

@keyframes waveMove {
    0%   { transform: translateX(0); }
    100% { transform: translateX(33.33%); }
}

/* Compass rose decorative element */
.compass {
    position: fixed;
    bottom: 30px;
    right: 40px;
    width: 90px;
    height: 90px;
    opacity: 0.12;
    z-index: 0;
    animation: compassSpin 60s linear infinite;
}

@keyframes compassSpin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* Plane */
.plane {
    position: fixed;
    top: 48px;
    left: -80px;
    font-size: 28px;
    animation: fly 20s linear infinite;
    filter: drop-shadow(0 2px 8px rgba(0,0,0,0.5));
    z-index: 2;
}

@keyframes fly {
    0%   { left: -80px; top: 48px; transform: scaleX(1); }
    100% { left: 110%; top: 36px; transform: scaleX(1); }
}

header {
    padding: 22px 40px;
    display: flex;
    align-items: center;
    position: relative;
    z-index: 2;
}

.logo {
    font-family: 'Cinzel', serif;
    font-size: 20px;
    font-weight: 700;
    color: var(--sand);
    text-decoration: none;
    letter-spacing: 0.04em;
}

.logo span { color: var(--gold); }

.logo-sub {
    font-family: 'Raleway', sans-serif;
    font-size: 10px;
    font-weight: 300;
    letter-spacing: 0.25em;
    color: rgba(255,255,255,0.4);
    text-transform: uppercase;
    display: block;
    margin-top: 2px;
}

main {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    position: relative;
    z-index: 2;
}

.box {
    background: linear-gradient(160deg, rgba(15,30,55,0.92) 0%, rgba(10,22,42,0.97) 100%);
    border: 1px solid rgba(201,168,76,0.25);
    border-radius: 4px;
    padding: 52px 56px;
    max-width: 400px;
    width: 100%;
    box-shadow:
            0 30px 80px rgba(0,0,0,0.5),
            inset 0 1px 0 rgba(201,168,76,0.15);
    position: relative;
    overflow: hidden;
}

/* Corner ornaments */
.box::before, .box::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    border-color: var(--gold);
    border-style: solid;
    opacity: 0.4;
}
.box::before { top: 12px; left: 12px; border-width: 1px 0 0 1px; }
.box::after  { bottom: 12px; right: 12px; border-width: 0 1px 1px 0; }

.icon {
    font-size: 36px;
    text-align: center;
    margin-bottom: 12px;
}

h1 {
    font-family: 'Cinzel', serif;
    font-size: 18px;
    font-weight: 700;
    color: var(--sand);
    text-align: center;
    letter-spacing: 0.08em;
    margin-bottom: 4px;
}

.subtitle {
    font-size: 11px;
    font-weight: 300;
    letter-spacing: 0.2em;
    color: rgba(255,255,255,0.3);
    text-align: center;
    text-transform: uppercase;
    margin-bottom: 36px;
}

.divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 28px;
}
.divider-line { flex: 1; height: 1px; background: rgba(201,168,76,0.2); }
.divider-diamond {
    width: 6px; height: 6px;
    background: var(--gold);
    transform: rotate(45deg);
    opacity: 0.5;
}

.field {
    margin-bottom: 18px;
}

label {
    display: block;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--gold);
    opacity: 0.8;
    margin-bottom: 7px;
}

input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255,255,255,0.04);
    border: 1px solid rgba(201,168,76,0.2);
    border-radius: 2px;
    font-family: 'Raleway', sans-serif;
    font-size: 14px;
    font-weight: 400;
    color: var(--sand);
    outline: none;
    transition: border-color 0.2s, background 0.2s;
}

input::placeholder { color: rgba(245,237,224,0.25); }

input:focus {
    border-color: rgba(201,168,76,0.55);
    background: rgba(255,255,255,0.07);
}

.error {
    background: rgba(180,40,40,0.12);
    border: 1px solid rgba(220,80,80,0.3);
    border-radius: 2px;
    padding: 10px 14px;
    font-size: 12px;
    color: #e07070;
    margin-bottom: 18px;
    letter-spacing: 0.03em;
    display: none;
}

.error.visible { display: block; }

.btn {
    width: 100%;
    background: linear-gradient(135deg, #c9a84c 0%, #e8c96b 50%, #c9a84c 100%);
    background-size: 200% 100%;
    color: var(--ink);
    border: none;
    padding: 14px;
    font-family: 'Cinzel', serif;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.15em;
    border-radius: 2px;
    cursor: pointer;
    box-shadow: 0 4px 24px rgba(201,168,76,0.25);
    transition: background-position 0.4s, box-shadow 0.2s, transform 0.15s;
    margin-top: 10px;
    text-transform: uppercase;
}

.btn:hover {
    background-position: 100% 0;
    box-shadow: 0 6px 32px rgba(201,168,76,0.45);
    transform: translateY(-1px);
}

.btn:disabled {
    opacity: 0.6;
    cursor: default;
    transform: none;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%       { transform: translateX(-8px); }
    40%       { transform: translateX(8px); }
    60%       { transform: translateX(-5px); }
    80%       { transform: translateX(5px); }
}

.box.shake { animation: shake 0.4s ease; }

footer {
    text-align: center;
    padding: 18px;
    font-size: 11px;
    letter-spacing: 0.12em;
    color: rgba(255,255,255,0.2);
    position: relative;
    z-index: 2;
    text-transform: uppercase;
}