:root {
    --primary-bg-gradient: linear-gradient(135deg, #06201d, #004d40);
    --modal-bg: rgba(255, 255, 255, 0.95);
    --text-dark: #012e28;
    --primary-accent: #0d9488;
    --error-red: #b91c1c;
    --radius: 16px;
    --transition-fast: 200ms ease;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

body {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--primary-bg-gradient);
    padding: 2.5rem 1.25rem;
    overflow: hidden;
    position: relative;
    color: var(--text-dark);
}

.branding-corner {
    position: fixed;
    top: 20px;
    left: 24px;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.7rem 0.95rem;
    border-radius: 14px;
    background: rgba(6, 32, 29, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.12);
    backdrop-filter: blur(10px);
    color: rgba(255, 255, 255, 0.92);
}

.branding-corner .brand-mark {
    width: 36px;
    height: 36px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.16);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    letter-spacing: 0.08em;
}

.branding-corner .brand-text {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.branding-corner .brand-title {
    font-weight: 900;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    font-size: 0.95rem;
}

.branding-corner .brand-sub {
    font-size: 0.78rem;
    line-height: 1.25;
    color: rgba(229, 231, 235, 0.85);
}

/* Professional auth modal layout */
.auth-modal {
    position: relative;
    z-index: 2;
    width: min(980px, 100%);
    display: grid;
    grid-template-columns: 1fr 1fr;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 24px 70px rgba(0, 0, 0, 0.55);
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: blur(10px);
}

.auth-modal.reverse .auth-right {
    order: 1;
}

.auth-modal.reverse .auth-left {
    order: 2;
}

.auth-left {
    position: relative;
    padding: 2.5rem 2.25rem;
    color: rgba(255, 255, 255, 0.92);
    background:
        radial-gradient(1200px 600px at 20% 20%, rgba(45, 212, 191, 0.26), transparent 60%),
        radial-gradient(900px 500px at 80% 85%, rgba(59, 130, 246, 0.16), transparent 55%),
        linear-gradient(135deg, rgba(2, 44, 40, 0.98), rgba(0, 77, 64, 0.92));
}

.auth-left::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(0deg, rgba(0,0,0,0.35), rgba(0,0,0,0.05));
    pointer-events: none;
}

.auth-left-content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    height: 100%;
    justify-content: center;
    gap: 1rem;
}

.auth-brand {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.5rem;
}

.auth-logo {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.16);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    letter-spacing: 0.08em;
}

.auth-brand-title {
    font-weight: 900;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    font-size: 1.15rem;
}

.auth-left h3 {
    margin: 0.25rem 0 0;
    font-size: 1.9rem;
    font-weight: 800;
    line-height: 1.15;
    color: #ffffff;
}

.auth-left p {
    margin: 0;
    max-width: 44ch;
    line-height: 1.55;
    color: rgba(229, 231, 235, 0.86);
}

.auth-right {
    padding: 2.1rem 2.1rem;
    background: rgba(255, 255, 255, 0.96);
}

.auth-modal h2 {
    text-align: center;
    letter-spacing: 0.18em;
    font-weight: 900;
    font-size: 1.05rem;
    margin-bottom: 1.25rem;
    color: rgba(17, 24, 39, 0.85);
}

.auth-modal .input-group {
    margin-bottom: 1rem;
}

.auth-modal .switch-link {
    margin-top: 0.85rem;
}

.auth-close {
    position: absolute;
    top: 14px;
    right: 16px;
    width: 34px;
    height: 34px;
    border-radius: 10px;
    border: 1px solid rgba(0,0,0,0.08);
    background: rgba(255,255,255,0.65);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    line-height: 1;
    color: rgba(17,24,39,0.6);
    user-select: none;
}

body::before {
    content: "";
    position: absolute;
    inset: -40%;
    background:
        radial-gradient(closest-side at 20% 25%, rgba(45, 212, 191, 0.18), transparent 60%),
        radial-gradient(closest-side at 80% 20%, rgba(34, 197, 94, 0.12), transparent 55%),
        radial-gradient(closest-side at 75% 85%, rgba(99, 102, 241, 0.10), transparent 55%),
        radial-gradient(closest-side at 15% 80%, rgba(236, 72, 153, 0.07), transparent 55%);
    filter: blur(20px);
    z-index: 0;
    pointer-events: none;
}

body::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.15), rgba(0, 0, 0, 0.35));
    z-index: 0;
    pointer-events: none;
}

/* --- Floating Background Text --- */
.bg-text {
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    pointer-events: none;
    z-index: 0;
}

.bg-text span {
    position: absolute;
    font-weight: 700;
    color: rgba(255, 255, 255, 0.05);
    white-space: nowrap;
    user-select: none;
    animation: floatDynamic 20s ease-in-out infinite;
}

@keyframes floatDynamic {
    0%, 100% { 
        transform: translate(0, 0) rotate(var(--rotate)); 
    }
    50% { 
        transform: translate(var(--x2), var(--y2)) rotate(calc(var(--rotate) - 5deg)); 
    }
}

/* --- Main Container --- */
.container {
    background: transparent;
    padding: 0;
    border-radius: 0;
    box-shadow: none;
    width: 100%;
    max-width: 980px;
    backdrop-filter: none;
    transition: none;
}

.container {
    border: none;
    overflow: visible;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.85rem 1rem;
}

.col-span-2 {
    grid-column: span 2;
}

.input-group {
    margin-bottom: 0;
}

.submit-btn {
    margin-top: 0.85rem;
}

.switch-link {
    margin-top: 1rem;
}

@media (max-width: 920px) {
    .container {
        max-width: 520px;
    }
    .auth-modal {
        grid-template-columns: 1fr;
        width: min(520px, 100%);
    }
    .auth-left {
        display: none;
    }
    .auth-right {
        padding: 2rem;
    }
    .form-grid {
        grid-template-columns: 1fr;
    }
    .col-span-2 {
        grid-column: span 1;
    }

    .branding-corner {
        top: 14px;
        left: 14px;
        right: 14px;
        width: auto;
    }
}

.page-title {
    position: absolute;
    top: 40px;
    left: 40px;
    color: #fff;
    z-index: 2;
}

.page-title h1 {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: 3px;
    text-shadow: 2px 2px 10px rgba(0, 0, 0, 0.2);
}

/* --- Form Elements --- */
h2 {
    margin-bottom: 1rem;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
}

.input-group {
    position: relative;
    margin-bottom: 1.5rem;
}

.input-group input {
    width: 100%;
    padding: 12px 12px;
    border-radius: 10px;
    border: 1px solid #d1d5db;
    outline: none;
    background: white;
    font-size: 1rem;
    transition: var(--transition-fast);
}

.input-group input:focus {
    border-color: var(--primary-accent);
    box-shadow: 0 0 0 3px rgba(13, 148, 136, 0.15);
}

.input-group label {
    position: absolute;
    top: 14px;
    left: 12px;
    font-size: 0.95rem;
    color: #6b7280;
    transition: var(--transition-fast);
    pointer-events: none;
}

/* Label floating logic */
.input-group input:focus + label, 
.input-group input:not(:placeholder-shown) + label {
    top: -10px;
    left: 8px;
    font-size: 0.75rem;
    background: white;
    padding: 0 6px;
    color: var(--primary-accent);
    font-weight: 600;
}

.submit-btn {
    width: 100%;
    background: var(--primary-accent);
    color: white;
    padding: 14px;
    border: none;
    border-radius: 10px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(13, 148, 136, 0.3);
}

.submit-btn:hover {
    background: #0f766e;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(13, 148, 136, 0.4);
}

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

/* --- Feedback Messages --- */
.error-msg {
    background: #fee2e2;
    color: var(--error-red);
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 1.2rem;
    font-size: 0.85rem;
    text-align: center;
    border: 1px solid #fecaca;
}

.success-msg {
    background: #ecfdf5;
    color: #065f46;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 1.2rem;
    font-size: 0.85rem;
    text-align: center;
    border: 1px solid #d1fae5;
}

/* --- Footer Link --- */
.switch-link {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.9rem;
    color: #6b7280;
}

.switch-link a {
    color: var(--primary-accent);
    text-decoration: none;
    font-weight: 700;
}

.switch-link a:hover {
    text-decoration: underline;
}

/* --- Responsive --- */
@media (max-width: 480px) {
    .container {
        width: 90%;
        padding: 1.5rem;
    }
    .page-title {
        top: 20px;
        left: 20px;
    }
    .page-title h1 {
        font-size: 1.8rem;
    }
}