﻿* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --panel-bg: rgba(255, 255, 255, 0.12);
    --panel-border: rgba(255, 255, 255, 0.30);
    --text-main: #f7f8fb;
    --text-soft: rgba(247, 248, 251, 0.72);
    --accent: #ff4d4d;
}

body {
    min-height: 100vh;
    font-family: "Segoe UI", "Noto Sans", Arial, sans-serif;
    color: var(--text-main);
    background-color: #0f0f12;
    background-image: url("../pictures/Background.jpg");
    background-position: center;
    background-size: cover;
    background-repeat: no-repeat;
    background-attachment: scroll;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    background: linear-gradient(rgba(0, 0, 0, 0.56), rgba(0, 0, 0, 0.56));
    pointer-events: none;
    z-index: 0;
}

.login-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px;
    position: relative;
    z-index: 1;
    animation: pageFade 0.7s ease-out;
}

.login-box {
    width: min(100%, 390px);
    padding: 34px 24px;
    border-radius: 18px;
    background: rgba(22, 22, 28, 0.62);
    border: 1px solid var(--panel-border);
    box-shadow: 0 16px 40px rgba(0, 0, 0, 0.4);
    position: relative;
    overflow: hidden;
    animation: cardRise 0.75s cubic-bezier(0.2, 0.8, 0.2, 1);
    transition: box-shadow 0.35s ease, border-color 0.35s ease;
}

@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
    .login-box {
        background: rgba(22, 22, 28, 0.42);
        -webkit-backdrop-filter: blur(8px) saturate(110%);
        backdrop-filter: blur(8px) saturate(110%);
    }
}

.login-box::after {
    content: "";
    position: absolute;
    inset: -40%;
    background: radial-gradient(circle, rgba(255, 115, 115, 0.12) 0%, transparent 58%);
    opacity: 0;
    transform: scale(0.85);
    transition: opacity 0.45s ease, transform 0.45s ease;
    pointer-events: none;
}

.login-box:hover {
    box-shadow: 0 22px 44px rgba(0, 0, 0, 0.48);
    border-color: rgba(255, 255, 255, 0.36);
}

.login-box:hover::after {
    opacity: 1;
    transform: scale(1);
}

.back-home {
    display: inline-block;
    text-decoration: none;
    color: #ffd7d7;
    font-size: 13px;
}

.back-home:hover {
    color: #ffffff;
}

h1 {
    text-align: center;
    font-size: 32px;
    margin-bottom: 8px;
}

.subtitle {
    color: var(--text-soft);
    margin-bottom: 20px;
    font-size: 15px;
}

.login-form {
    display: grid;
    gap: 12px;
}

.login-form[hidden] {
    display: none;
}

.login-form label {
    font-size: 14px;
    font-weight: 600;
}

.login-form input[type="text"],
.login-form input[type="email"],
.login-form input[type="password"] {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    padding: 12px 14px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.password-field {
    position: relative;
}

.password-field input[type="password"],
.password-field input[type="text"] {
    padding-right: 84px;
}

.toggle-password {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    color: #ffdede;
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    transition: color 0.2s ease, background 0.2s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.toggle-password img {
    width: 21px;
    height: 21px;
    object-fit: contain;
    opacity: 0.92;
    filter: brightness(1.2);
    transition: opacity 0.2s ease, filter 0.2s ease;
}

.toggle-password:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.1);
}

.toggle-password:hover img {
    opacity: 1;
    filter: brightness(1.35);
}

.toggle-password:focus-visible {
    outline: 2px solid rgba(255, 112, 112, 0.7);
    outline-offset: 1px;
}

.login-form input::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.login-form input[type="text"]:focus,
.login-form input[type="email"]:focus,
.login-form input[type="password"]:focus {
    border-color: rgba(255, 91, 91, 0.95);
    box-shadow: 0 0 0 3px rgba(255, 91, 91, 0.2);
    background: rgba(255, 255, 255, 0.14);
}

.login-form input[readonly] {
    cursor: default;
    color: rgba(255, 255, 255, 0.72);
    background: rgba(255, 255, 255, 0.035);
}

#verify-code {
    text-align: center;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 8px;
}

.form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-top: 4px;
}

.form-row.forgot-center {
    justify-content: center;
}

.forgot-link {
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.2px;
    color: #ffe3e3;
    text-decoration: none;
    position: relative;
    transition: color 0.25s ease, text-shadow 0.25s ease;
}

.forgot-link::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, #ff8a8a, #ffd3d3);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s ease;
}

.forgot-link:hover {
    color: #ffffff;
    text-shadow: 0 0 10px rgba(255, 130, 130, 0.45);
}

.forgot-link:hover::after {
    transform: scaleX(1);
}

.back-home {
    transition: color 0.2s ease, transform 0.2s ease;
}

.back-home:hover {
    color: #ffffff;
}

button[type="submit"] {
    margin-top: 8px;
    border: 0;
    border-radius: 12px;
    background: linear-gradient(135deg, #ff4d4d, #d92e2e);
    color: #fff;
    font-size: 16px;
    font-weight: 700;
    padding: 13px 16px;
    cursor: pointer;
    transition: background 0.25s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

button[type="submit"]:hover {
    background: linear-gradient(135deg, #ff5b5b, #e23535);
    box-shadow: 0 10px 26px rgba(255, 77, 77, 0.35);
    filter: brightness(1.04);
}

button[type="submit"]:active {
    filter: brightness(0.98);
}

button[type="submit"]:disabled {
    cursor: not-allowed;
    opacity: 0.58;
    box-shadow: none;
    filter: none;
}

.signup-note {
    margin-top: 16px;
    font-size: 14px;
    color: var(--text-soft);
    animation: fadeUp 0.9s ease-out;
}

.signup-note[data-state="error"] {
    color: #ff9aa8;
}

.signup-note[data-state="success"] {
    color: #8ee6b6;
}

.signup-note a {
    color: #ffffff;
    text-decoration: none;
    font-weight: 700;
    letter-spacing: 0.2px;
    position: relative;
    transition: color 0.25s ease, text-shadow 0.25s ease;
}

.signup-note a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 100%;
    height: 1px;
    background: linear-gradient(90deg, #ff7d7d, #ffd1d1);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.25s ease;
}

.signup-note a:hover {
    color: #ffe3e3;
    text-shadow: 0 0 10px rgba(255, 120, 120, 0.4);
}

.signup-note a:hover::after {
    transform: scaleX(1);
}

@media (max-width: 480px) {
    .login-box {
        padding: 24px 18px;
        border-radius: 16px;
    }

    h1 {
        font-size: 28px;
    }
}

@keyframes pageFade {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes cardRise {
    from {
        opacity: 0;
        transform: translateY(18px) scale(0.985);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes fadeUp {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.login-email-verification[hidden] {
    display: none;
}

.login-email-verification {
    text-align: center;
    animation: fadeUp 0.3s ease both;
}

.login-box.is-verifying {
    padding: 38px 28px 30px;
}

.login-box.is-verifying > h1,
.login-box.is-verifying > .login-footer-links {
    display: none;
}

.login-box.is-verifying #login-status {
    margin: 18px 0 0;
    text-align: center;
    font-size: 12px;
}

.login-verification-icon {
    display: grid;
    width: 54px;
    height: 54px;
    place-items: center;
    margin: 0 auto 15px;
    border: 1px solid rgba(255, 125, 125, 0.35);
    border-radius: 16px;
    color: #ffb2b2;
    background: rgba(255, 82, 105, 0.12);
    font-size: 22px;
}

.login-email-verification h2 {
    margin: 0 0 8px;
    color: #fff;
    font-size: 24px;
}

.login-email-verification > p {
    margin: 0 0 19px;
    color: var(--text-soft);
    font-size: 13px;
    line-height: 1.55;
}

.login-email-verification > p strong {
    color: #fff;
}

#login-verification-code {
    height: 54px;
    text-align: center;
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 9px;
}

.login-verification-actions {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 14px;
}

.login-verification-actions button {
    border: 0;
    color: rgba(255, 255, 255, 0.7);
    background: none;
    font: inherit;
    font-size: 11px;
    font-weight: 700;
    cursor: pointer;
}

.login-verification-actions button:hover {
    color: #fff;
}

.login-verification-actions button:disabled {
    cursor: wait;
    opacity: 0.5;
}
