:root {
    --sky-top: #7ec8f0;
    --sky-bottom: #3d7fd6;
    --navy: #143a63;
    --blue: #2e79c9;
    --blue-dark: #1f5aa0;
    --yellow: #ffcf3f;
    --yellow-dark: #e9a91a;
    --snow: #f5fbff;
    --ink: #143a63;
    --danger: #d64550;
    --field: #eef5fc;
    --field-border: #cfe0f2;
}

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

html, body { margin: 0; padding: 0; min-height: 100%; }

body {
    font-family: 'Poppins', sans-serif;
    color: var(--ink);
    background: linear-gradient(180deg, var(--sky-top) 0%, var(--sky-bottom) 100%);
    min-height: 100vh;
    overflow-x: hidden;
}

a { text-decoration: none; color: inherit; }

.brand-logo { width: clamp(180px, 26vw, 260px); display: block; filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.25)); }

.page {
    position: relative;
    z-index: 2;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 26px 16px 40px;
}
.brand { display: inline-block; font-size: clamp(28px, 5vw, 46px); margin-bottom: 18px; }
.card-wrap { width: 100%; display: flex; justify-content: center; }

.card {
    width: 100%;
    max-width: 860px;
    background: #fff;
    border-radius: 28px;
    border: 3px solid #e4eef8;
    box-shadow: 0 12px 0 rgba(20, 58, 99, 0.12), 0 22px 40px rgba(20, 58, 99, 0.3);
    color: var(--ink);
    position: relative;
    padding: 30px 34px 34px;
}

.modal-close {
    position: absolute;
    font-family: 'Fredoka', sans-serif;
    font-size: 26px;
    color: #9bb4cd;
    top: 12px;
    right: 16px;
    width: 40px; height: 40px; line-height: 40px;
    text-align: center;
    border-radius: 999px;
    cursor: pointer;
    z-index: 3;
    transition: color 200ms ease, background 200ms ease;
}
.modal-close:hover { color: var(--navy); background: #eef5fc; }

/* Tek sutunlu kart: sifre unuttum / sifre yenile sayfalari */
.card.narrow { max-width: 460px; }
.card.narrow .create-form h1 { text-align: center; }
.lead { margin: 0 0 20px; font-size: 15px; line-height: 1.6; color: #4a6d92; text-align: center; }
.note { margin: 16px 0 0; font-size: 14px; line-height: 1.6; text-align: center; color: #4a6d92; }

/* Two-column layout */
.create-grid {
    display: grid;
    grid-template-columns: minmax(220px, 300px) 1fr;
    gap: 26px;
    align-items: center;
}

/* Left: penguin preview */
.preview { display: flex; justify-content: center; }
.preview-burst {
    width: 100%;
    max-width: 300px;
    aspect-ratio: 1 / 1;
    display: grid;
    place-items: center;
    border-radius: 22px;
    background:
        repeating-conic-gradient(from 0deg at 50% 55%, #ffffff 0deg 12deg, #eef5fc 12deg 24deg);
    box-shadow: inset 0 0 0 3px #e4eef8;
    overflow: hidden;
}
#penguin-canvas { width: 78%; height: auto; filter: drop-shadow(0 8px 10px rgba(20, 58, 99, 0.18)); }

/* Right: form */
.create-form h1 {
    font-family: 'Fredoka', sans-serif;
    font-weight: 600;
    font-size: 26px;
    color: var(--navy);
    margin: 0 0 16px;
}

form { width: 100%; margin: 0; }
.form-group { margin-bottom: 14px; }

.step {
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: 'Fredoka', sans-serif;
    font-weight: 600;
    font-size: 15px;
    color: var(--navy);
    margin-bottom: 7px;
}
.step .num {
    display: grid;
    place-items: center;
    width: 22px; height: 22px;
    border-radius: 999px;
    background: var(--blue);
    color: #fff;
    font-size: 13px;
}

.form-group input:not([type="hidden"]) {
    font-family: 'Poppins', sans-serif;
    font-size: 15px;
    font-weight: 400;
    width: 100%;
    padding: 12px 15px;
    line-height: 1.4;
    color: var(--ink);
    background: var(--field);
    border: 2px solid var(--field-border);
    border-radius: 12px;
    transition: border-color 150ms ease, box-shadow 150ms ease;
}
#password-repeat-group { margin-top: -6px; }
.form-group input::placeholder { color: #90a7bf; }
.form-group input:focus {
    outline: 0;
    border-color: var(--blue);
    box-shadow: 0 0 0 4px rgba(46, 121, 201, 0.18);
}

/* Colour grid */
.colours {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 7px;
}
.swatch {
    aspect-ratio: 1 / 1;
    border: 2px solid rgba(20, 58, 99, 0.18);
    border-radius: 8px;
    padding: 0;
    cursor: pointer;
    transition: transform 100ms ease, box-shadow 100ms ease, border-color 100ms ease;
}
.swatch:hover { transform: translateY(-2px); }
.swatch.selected {
    border-color: var(--navy);
    box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--yellow);
    transform: translateY(-2px);
}

.form-group .feedback {
    font-family: 'Poppins', sans-serif;
    font-size: 13px;
    font-weight: 400;
    color: var(--danger);
    margin-top: 6px;
}
.form-group .invalid { border-color: var(--danger); background: #fff2f3; }
.form-group .invalid:focus { box-shadow: 0 0 0 4px rgba(214, 69, 80, 0.2); border-color: var(--danger); }

.h-captcha { display: flex; }

.success-msg { font-size: 16px; line-height: 1.6; text-align: center; margin: 30px 0; }

/* Button */
.button {
    font-family: 'Fredoka', sans-serif;
    font-size: 19px;
    font-weight: 600;
    width: 100%;
    white-space: nowrap;
    text-align: center;
    color: var(--navy);
    background: var(--yellow);
    padding: 14px 15px;
    margin-top: 8px;
    border: none;
    border-radius: 999px;
    box-shadow: 0 5px 0 var(--yellow-dark);
    cursor: pointer;
    transition: transform 120ms ease, background 120ms ease;
}
.button:hover { background: #ffd956; transform: translateY(-2px); }
.button:active { transform: translateY(2px); box-shadow: 0 2px 0 var(--yellow-dark); }

.foot {
    position: relative;
    z-index: 2;
    color: #fff;
    font-family: 'Fredoka', sans-serif;
    font-weight: 500;
    margin-top: 20px;
    text-shadow: 0 2px 4px rgba(20, 58, 99, 0.5);
}
.foot a { color: var(--yellow); }
.foot a:hover { text-decoration: underline; }

/* Snow */
.snow-layer { position: fixed; inset: 0; pointer-events: none; z-index: 1; }
.flake { position: absolute; top: -12px; color: #fff; animation: fall linear infinite; }
@keyframes fall {
    0% { transform: translateY(-12px) translateX(0); opacity: 0; }
    10% { opacity: 0.85; }
    100% { transform: translateY(100vh) translateX(28px); opacity: 0.15; }
}

/* Fade */
.fade { animation: fade 0.25s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

@media (max-width: 640px) {
    .create-grid { grid-template-columns: 1fr; gap: 14px; }
    .preview-burst { max-width: 190px; }
    .card { padding: 24px 20px 26px; border-radius: 22px; }
    .colours { grid-template-columns: repeat(8, 1fr); }
}
