:root {
    --bg: #f4f7fb;
    --panel: #ffffff;
    --primary: #f5b700;
    --primary-strong: #e89b00;
    --secondary: #1d3557;
    --secondary-soft: #2d4d72;
    --text: #1f2937;
    --muted: #64748b;
    --border: rgba(148, 163, 184, 0.28);
    --shadow: 0 18px 45px rgba(15, 23, 42, 0.10);
}

* {
    box-sizing: border-box;
}

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

body {
    min-height: 100vh;
    font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(180deg, var(--bg) 0%, #edf3fb 100%);
    color: var(--text);
}

/* =========================================
   FEJLÉC
========================================= */

.header {
    width: 100%;
    background: linear-gradient(
        135deg,
        var(--secondary) 0%,
        var(--secondary-soft) 100%
    );
    color: white;
    box-shadow: 0 12px 30px rgba(29, 53, 87, 0.18);
}

.header-content {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 18px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.logo {
    display: inline-flex;
    align-items: center;
    color: white;
    text-decoration: none;
    font-size: 24px;
    font-weight: 800;
    letter-spacing: 0.02em;
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.logo:hover {
    opacity: 0.92;
    transform: translateY(-1px);
}

/* =========================================
   BEJELENTKEZÉS
========================================= */

.login-container {
    min-height: calc(100vh - 77px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}

.login-box {
    width: 100%;
    max-width: 440px;
    padding: 38px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--shadow);
    position: relative;
}

.login-box h1 {
    margin: 0 0 10px;
    text-align: center;
    color: var(--secondary);
    font-size: 2rem;
    line-height: 1.2;
}

.login-description {
    margin: 0 0 25px;
    text-align: center;
    color: var(--muted);
    line-height: 1.5;
}

/* =========================================
   GOOGLE BEJELENTKEZÉS
========================================= */

.google-login-button {
    width: 100%;
    min-height: 50px;
    padding: 12px 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;

    background: #ffffff;
    color: #1f2937;

    border: 1px solid #d1d5db;
    border-radius: 12px;

    text-decoration: none;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 600;

    cursor: pointer;

    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.06);

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        border-color 0.2s ease,
        background 0.2s ease;
}

.google-login-button:hover {
    transform: translateY(-1px);
    background: #f8fafc;
    border-color: #b8c0cc;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.10);
}

.google-login-button:active {
    transform: translateY(0);
}

.google-icon {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.google-icon svg {
    width: 22px;
    height: 22px;
    display: block;
}

/* =========================================
   ELVÁLASZTÓ
========================================= */

.login-divider {
    width: 100%;
    margin: 25px 0;
    display: flex;
    align-items: center;
    gap: 14px;
    color: #94a3b8;
    font-size: 0.85rem;
}

.login-divider::before,
.login-divider::after {
    content: "";
    flex: 1;
    height: 1px;
    background: var(--border);
}

.login-divider span {
    flex-shrink: 0;
    padding: 0 2px;
}

/* =========================================
   ŰRLAP
========================================= */

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--secondary);
    font-weight: 600;
}

.form-group input {
    width: 100%;
    min-height: 50px;
    padding: 14px 16px;

    border: 1px solid var(--border);
    border-radius: 12px;

    background: #f8fafc;
    color: var(--text);

    font-family: inherit;
    font-size: 1rem;

    transition:
        border-color 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}

.form-group input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(245, 183, 0, 0.15);
    background: #ffffff;
}

.form-group input::placeholder {
    color: #94a3b8;
}

/* =========================================
   ELFELEJTETT JELSZÓ
========================================= */

.forgot-password {
    display: block;
    margin-top: 10px;
    text-align: right;

    color: var(--secondary);
    font-size: 0.9rem;
    font-weight: 600;

    text-decoration: none;

    transition: color 0.2s ease;
}

.forgot-password:hover {
    color: var(--primary-strong);
}

/* =========================================
   BEJELENTKEZÉS GOMB
========================================= */

.login-submit {
    width: 100%;
    min-height: 50px;
    margin-top: 8px;
    padding: 14px 20px;

    border: none;
    border-radius: 12px;

    background: linear-gradient(
        135deg,
        var(--primary) 0%,
        #f7d870 100%
    );

    color: var(--secondary);

    cursor: pointer;

    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;

    box-shadow: 0 12px 24px rgba(245, 183, 0, 0.22);

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        filter 0.2s ease;
}

.login-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 28px rgba(245, 183, 0, 0.30);
    filter: brightness(1.02);
}

.login-submit:active {
    transform: translateY(0);
}

/* =========================================
   HIBAÜZENET
========================================= */

#message {
    margin: 12px 0 0;
    text-align: center;
    color: #dc2626;
    font-size: 0.9rem;
    line-height: 1.4;
}

/* =========================================
   REGISZTRÁCIÓ
========================================= */

.register-text {
    margin: 25px 0 0;
    text-align: center;
    color: var(--muted);
    line-height: 1.5;
}

.register-text a {
    color: var(--secondary);
    font-weight: 700;
    text-decoration: none;
    transition: color 0.2s ease;
}

.register-text a:hover {
    color: var(--primary-strong);
}

/* =========================================
   VISSZA A FŐOLDALRA
========================================= */

.back-home {
    display: block;
    margin-top: 18px;
    text-align: center;

    color: var(--muted);
    font-size: 0.9rem;

    text-decoration: none;

    transition: color 0.2s ease;
}

.back-home:hover {
    color: var(--secondary);
}

/* =========================================
   TÉMA VÁLTÓ
========================================= */

.theme-toggle {
    position: fixed;
    right: 25px;
    bottom: 25px;

    width: 50px;
    height: 50px;

    border: none;
    border-radius: 50%;

    background: #1d3557;
    color: white;

    font-size: 22px;

    cursor: pointer;

    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.2);

    z-index: 9999;

    transition:
        transform 0.3s ease,
        box-shadow 0.3s ease;
}

.theme-toggle:hover {
    transform: scale(1.1);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.25);
}

/* =========================================
   GOOGLE MODAL
========================================= */

.google-modal-overlay {
    position: fixed;
    inset: 0;

    width: 100%;
    height: 100%;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 20px;

    background: rgba(5, 15, 30, 0.65);

    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transition:
        opacity 0.25s ease,
        visibility 0.25s ease;

    z-index: 10000;
}

.google-modal-overlay.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.google-modal {
    position: relative;

    width: min(420px, 100%);

    padding: 32px 30px 30px;

    text-align: center;

    background: #ffffff;

    border-radius: 20px;

    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.25);

    transform: scale(0.85) translateY(20px);
    opacity: 0;

    transition:
        transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
        opacity 0.2s ease;
}

.google-modal-overlay.show .google-modal {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.google-modal-close {
    position: absolute;
    top: 12px;
    right: 14px;

    width: 36px;
    height: 36px;

    display: flex;
    align-items: center;
    justify-content: center;

    border: none;
    border-radius: 50%;

    background: transparent;
    color: #64748b;

    font-size: 25px;
    line-height: 1;

    cursor: pointer;

    transition:
        background 0.2s ease,
        color 0.2s ease;
}

.google-modal-close:hover {
    background: #f1f5f9;
    color: #1f2937;
}

.google-modal-icon {
    width: 70px;
    height: 70px;

    margin: 0 auto 18px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: #fef3c7;

    font-size: 34px;

    border: 3px solid #facc15;
}

.google-modal h2 {
    margin: 0 0 10px;

    color: #172554;

    font-size: 24px;
    line-height: 1.25;
}

.google-modal p {
    margin: 0 auto;

    max-width: 350px;

    color: #64748b;

    font-size: 15px;
    line-height: 1.6;
}

.google-modal-actions {
    display: flex;
    flex-direction: column;
    gap: 10px;

    margin-top: 25px;
}

.google-modal-primary,
.google-modal-secondary {
    width: 100%;
    min-height: 46px;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 12px 18px;

    border-radius: 11px;

    font-family: inherit;
    font-size: 0.95rem;
    font-weight: 700;

    cursor: pointer;

    text-decoration: none;

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease,
        background 0.2s ease;
}

.google-modal-primary {
    border: none;

    background: linear-gradient(
        135deg,
        var(--primary),
        #f7d870
    );

    color: var(--secondary);

    box-shadow: 0 8px 18px rgba(245, 183, 0, 0.20);
}

.google-modal-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 11px 22px rgba(245, 183, 0, 0.28);
}

.google-modal-secondary {
    border: 1px solid #d1d5db;

    background: #ffffff;

    color: #475569;
}

.google-modal-secondary:hover {
    background: #f8fafc;
}

/* =========================================
   SIKERES BEJELENTKEZÉS MODAL
========================================= */

.success-modal-overlay {
    position: fixed;
    inset: 0;

    width: 100%;
    height: 100%;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 20px;

    background: rgba(5, 15, 30, 0.65);

    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);

    opacity: 0;
    visibility: hidden;
    pointer-events: none;

    transition:
        opacity 0.25s ease,
        visibility 0.25s ease;

    z-index: 10001;
}

.success-modal-overlay.show {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}

.success-modal {
    position: relative;

    width: min(420px, 100%);
    max-width: 420px;

    padding: 35px 30px 30px;

    text-align: center;

    background: #ffffff;

    border-radius: 20px;

    box-shadow: 0 25px 70px rgba(0, 0, 0, 0.25);

    transform: scale(0.8) translateY(20px);
    opacity: 0;

    transition:
        transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
        opacity 0.2s ease;
}

.success-modal-overlay.show .success-modal {
    transform: scale(1) translateY(0);
    opacity: 1;
}

.success-icon {
    width: 78px;
    height: 78px;

    margin: 0 auto 20px;

    display: flex;
    align-items: center;
    justify-content: center;

    border-radius: 50%;

    background: #dcfce7;
    color: #16a34a;

    font-size: 45px;
    font-weight: 800;
    line-height: 1;

    border: 4px solid #22c55e;

    animation: successIconPop 0.5s ease;
}

@keyframes successIconPop {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    70% {
        transform: scale(1.15);
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.success-modal h2 {
    margin: 0 0 10px;

    color: #172554;

    font-size: 25px;
    line-height: 1.25;
}

.success-modal p {
    margin: 0 auto;

    max-width: 360px;

    color: #64748b;

    font-size: 15px;
    line-height: 1.6;
}

.success-loader {
    width: 100%;
    height: 4px;

    margin-top: 25px;

    overflow: hidden;

    border-radius: 10px;

    background: #e2e8f0;
}

#successProgress {
    width: 0;
    height: 100%;

    background: #22c55e;

    border-radius: inherit;

    animation: successProgress 1.8s linear forwards;
}

@keyframes successProgress {
    from {
        width: 0;
    }

    to {
        width: 100%;
    }
}

.first-login .success-icon {
    background: #fef9c3;
    color: #ca8a04;
    border-color: #facc15;
}

.first-login #successProgress {
    background: #facc15;
}

/* =========================================
   DARK MODE
========================================= */

body.dark-mode {
    background:
        radial-gradient(
            circle at 15% 12%,
            rgba(56, 189, 248, 0.18),
            transparent 22%
        ),
        radial-gradient(
            circle at 85% 18%,
            rgba(168, 85, 247, 0.15),
            transparent 24%
        ),
        radial-gradient(
            circle at 50% 100%,
            rgba(251, 191, 36, 0.08),
            transparent 30%
        ),
        linear-gradient(
            180deg,
            #060d18 0%,
            #0c1728 100%
        );
}

body.dark-mode .login-box {
    background:
        linear-gradient(
            180deg,
            rgba(17, 24, 39, 0.98),
            rgba(12, 20, 31, 0.98)
        );

    border: 1px solid rgba(148, 163, 184, 0.16);

    box-shadow:
        0 20px 50px rgba(2, 6, 23, 0.42),
        inset 0 1px 0 rgba(255, 255, 255, 0.02);
}

body.dark-mode .login-box h1,
body.dark-mode .form-group label {
    color: #edf6ff;
}

body.dark-mode .login-description {
    color: #d9e5f8;
}

body.dark-mode .google-login-button {
    background: #111827;
    border-color: rgba(148, 163, 184, 0.25);
    color: #f8fafc;
}

body.dark-mode .google-login-button:hover {
    background: #172033;
    border-color: rgba(148, 163, 184, 0.4);
}

body.dark-mode .login-divider {
    color: #94a3b8;
}

body.dark-mode .login-divider::before,
body.dark-mode .login-divider::after {
    background: rgba(148, 163, 184, 0.20);
}

body.dark-mode .form-group input {
    background: rgba(8, 15, 25, 0.88);
    border-color: rgba(148, 163, 184, 0.2);
    color: #f8fafc;
}

body.dark-mode .form-group input::placeholder {
    color: #9db0cb;
}

body.dark-mode .form-group input:focus {
    background: rgba(8, 15, 25, 0.95);
}

body.dark-mode .login-submit {
    background: linear-gradient(
        135deg,
        #fbbf24,
        #f59e0b
    );

    color: #111827;

    box-shadow: 0 14px 30px rgba(251, 191, 36, 0.26);
}

body.dark-mode .forgot-password {
    color: #edf6ff;
}

body.dark-mode .forgot-password:hover {
    color: #7dd3fc;
}

body.dark-mode .register-text {
    color: #d9e5f8;
}

body.dark-mode .register-text a {
    color: #edf6ff;
}

body.dark-mode .register-text a:hover {
    color: #7dd3fc;
}

body.dark-mode .back-home {
    color: #d9e5f8;
}

body.dark-mode .back-home:hover {
    color: #7dd3fc;
}

body.dark-mode #message {
    color: #f87171;
}

body.dark-mode .google-modal {
    background:
        linear-gradient(
            180deg,
            #111827,
            #0f172a
        );

    border: 1px solid rgba(148, 163, 184, 0.12);

    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

body.dark-mode .google-modal-close {
    color: #94a3b8;
}

body.dark-mode .google-modal-close:hover {
    background: #1e293b;
    color: #f8fafc;
}

body.dark-mode .google-modal h2 {
    color: #f8fafc;
}

body.dark-mode .google-modal p {
    color: #94a3b8;
}

body.dark-mode .google-modal-secondary {
    background: #111827;
    border-color: #334155;
    color: #cbd5e1;
}

body.dark-mode .google-modal-secondary:hover {
    background: #1e293b;
}

body.dark-mode .success-modal {
    background:
        linear-gradient(
            180deg,
            #111827,
            #0f172a
        );

    border: 1px solid rgba(148, 163, 184, 0.12);

    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
}

body.dark-mode .success-modal h2 {
    color: #f8fafc;
}

body.dark-mode .success-modal p {
    color: #94a3b8;
}

body.dark-mode .success-loader {
    background: #334155;
}

/* =========================================
   MOBIL
========================================= */

@media (max-width: 600px) {
    .header-content {
        padding: 16px;
    }

    .logo {
        font-size: 21px;
    }

    .login-container {
        min-height: calc(100vh - 65px);
        padding: 25px 15px;
    }

    .login-box {
        padding: 28px 22px;
        border-radius: 18px;
    }

    .login-box h1 {
        font-size: 1.7rem;
    }

    .theme-toggle {
        right: 18px;
        bottom: 18px;

        width: 46px;
        height: 46px;

        font-size: 20px;
    }

    .google-login-button {
        min-height: 48px;
        padding: 11px 15px;
    }

    .login-divider {
        margin: 22px 0;
    }

    .google-modal-overlay {
        padding: 15px;
    }

    .google-modal {
        padding: 30px 22px 25px;
        border-radius: 18px;
    }

    .google-modal-icon {
        width: 64px;
        height: 64px;
        font-size: 30px;
    }

    .google-modal h2 {
        font-size: 22px;
    }

    .google-modal p {
        font-size: 14px;
    }

    .success-modal-overlay {
        padding: 15px;
    }

    .success-modal {
        width: 100%;
        max-width: 420px;

        padding: 32px 22px 25px;

        border-radius: 18px;
    }

    .success-icon {
        width: 70px;
        height: 70px;

        margin-bottom: 17px;

        font-size: 40px;
    }

    .success-modal h2 {
        font-size: 22px;
    }

    .success-modal p {
        font-size: 14px;
    }

    .success-loader {
        margin-top: 22px;
    }
}

@media (max-width: 380px) {
    .login-box {
        padding: 25px 18px;
    }

    .login-box h1 {
        font-size: 1.55rem;
    }

    .google-login-button {
        font-size: 0.92rem;
    }

    .google-modal {
        padding: 28px 18px 22px;
    }

    .success-modal {
        padding: 28px 18px 22px;
    }

    .success-icon {
        width: 64px;
        height: 64px;
        font-size: 36px;
    }

    .success-modal h2 {
        font-size: 20px;
    }
}