:root {
    --bg-dark: #050505;
    --glass-bg: rgba(18, 18, 20, 0.9);
    --glass-border: rgba(255, 255, 255, 0.08);
    --accent: #dc2626;
    --accent-hover: #b91c1c;
    --accent-2: #f43f5e;
    --text-main: #ffffff;
    --text-muted: #9ca3af;
    --input-bg: rgba(0, 0, 0, 0.45);
    --input-border: rgba(255, 255, 255, 0.12);
    --focus-glow: rgba(220, 38, 38, 0.25);
    --font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    --transition-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    --transition-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: var(--font-family);
    background-color: var(--bg-dark);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow-x: hidden;
}

.auth-bg {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background-image: url('https://images.unsplash.com/photo-1536440136628-849c177e76a1?q=80&w=2525&auto=format&fit=crop');
    background-size: cover;
    background-position: center;
}

.auth-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at center, rgba(0, 0, 0, 0.5) 0%, #000000 100%);
    backdrop-filter: blur(4px);
}

.auth-container {
    width: 100%;
    max-width: 480px;
    padding: 24px;
    position: relative;
    z-index: 10;
    animation: fadeInUp 0.7s var(--transition-bounce);
}

.auth-card {
    background: var(--glass-bg);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border: 1px solid var(--glass-border);
    border-radius: 28px;
    padding: 52px 44px;
    box-shadow: 0 50px 100px -20px rgba(0, 0, 0, 0.85);
}

.auth-header {
    text-align: center;
    margin-bottom: 36px;
}

.brand-logo {
    font-size: 30px;
    font-weight: 800;
    letter-spacing: -1px;
    color: var(--text-main);
    text-decoration: none;
    display: inline-block;
    margin-bottom: 28px;
    transition: transform 0.3s var(--transition-bounce);
}

.brand-logo:hover {
    transform: scale(1.02);
}

.brand-logo span { 
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.auth-title {
    font-size: 26px;
    font-weight: 700;
    margin: 0 0 10px 0;
    letter-spacing: -0.02em;
}

.auth-subtitle {
    color: var(--text-muted);
    font-size: 15px;
    margin: 0;
    line-height: 1.5;
}

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

.input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 18px;
    color: var(--text-muted);
    pointer-events: none;
    transition: color 0.3s ease;
}

.form-input {
    width: 100%;
    height: 56px;
    background: var(--input-bg);
    border: 1px solid var(--input-border);
    border-radius: 14px;
    padding: 0 18px 0 52px;
    color: var(--text-main);
    font-size: 15px;
    font-family: inherit;
    transition: all 0.3s var(--transition-smooth);
}

.form-input::placeholder { color: #666; }

.form-input:focus {
    outline: none;
    border-color: var(--accent);
    background: rgba(0, 0, 0, 0.65);
    box-shadow: 0 0 0 4px var(--focus-glow);
}

.form-input:focus + .input-icon { color: var(--text-main); }

.btn-primary {
    width: 100%;
    height: 56px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s var(--transition-smooth);
    margin-top: 12px;
}

.btn-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(220, 38, 38, 0.4);
}

.btn-primary:active {
    transform: scale(0.98);
}

.btn-primary:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
}

.social-buttons {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 28px;
}

.btn-social {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    height: 52px;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--input-border);
    border-radius: 14px;
    color: var(--text-main);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.25s var(--transition-smooth);
}

.btn-social:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.25);
    transform: translateY(-2px);
}

.divider {
    display: flex;
    align-items: center;
    text-align: center;
    color: var(--text-muted);
    font-size: 13px;
    margin-bottom: 28px;
}

.divider::before, .divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.divider span { padding: 0 16px; }

.form-footer {
    text-align: center;
    margin-top: 28px;
    font-size: 14px;
    color: var(--text-muted);
}

.form-footer a {
    color: var(--text-main);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.25s;
}

.form-footer a:hover { color: var(--accent); }

.back-btn {
    position: absolute;
    top: 44px;
    left: 44px;
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    padding: 12px 24px;
    border-radius: 100px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(12px);
    transition: all 0.3s var(--transition-smooth);
    z-index: 20;
}

.back-btn:hover {
    color: white;
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
    transform: translateX(-4px);
}

.error-message {
    background: rgba(220, 38, 38, 0.12);
    border: 1px solid rgba(220, 38, 38, 0.35);
    color: #fca5a5;
    padding: 14px;
    border-radius: 12px;
    font-size: 14px;
    margin-bottom: 22px;
    display: none;
    text-align: center;
}

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

@media (max-width: 768px) {
    .auth-container { max-width: 440px; padding: 18px; }
    .auth-card { padding: 44px 36px; border-radius: 24px; }
    .brand-logo { font-size: 28px; margin-bottom: 24px; }
    .auth-title { font-size: 24px; }
    .back-btn { top: 28px; left: 28px; padding: 10px 20px; }
}

@media (max-width: 500px) {
    body { align-items: flex-start; padding-top: 85px; }
    .auth-container { max-width: 100%; padding: 14px; }
    .auth-card { padding: 36px 28px; border-radius: 20px; }
    .auth-header { margin-bottom: 28px; }
    .brand-logo { font-size: 26px; margin-bottom: 20px; }
    .auth-title { font-size: 22px; margin-bottom: 8px; }
    .auth-subtitle { font-size: 14px; }
    .back-btn { top: 22px; left: 22px; padding: 10px 18px; font-size: 13px; gap: 8px; }
    .back-btn svg { width: 16px; height: 16px; }
    .social-buttons { grid-template-columns: 1fr; gap: 14px; margin-bottom: 24px; }
    .btn-social { height: 50px; font-size: 14px; }
    .divider { font-size: 12px; margin-bottom: 24px; }
    .form-group { margin-bottom: 18px; }
    .form-input { height: 52px; font-size: 15px; padding-left: 48px; border-radius: 12px; }
    .input-icon { left: 16px; width: 18px; height: 18px; }
    .btn-primary { height: 52px; font-size: 15px; border-radius: 12px; }
    .form-footer { font-size: 13px; margin-top: 24px; }
    .form-options { flex-direction: column; align-items: flex-start; gap: 14px; }
    .checkbox-wrapper { font-size: 13px; }
    .forgot-link { font-size: 13px; }
}

@media (max-width: 380px) {
    body { padding-top: 75px; }
    .auth-card { padding: 32px 22px; border-radius: 18px; }
    .brand-logo { font-size: 24px; }
    .auth-title { font-size: 20px; }
    .auth-subtitle { font-size: 13px; }
    .back-btn { top: 18px; left: 18px; padding: 8px 14px; font-size: 12px; }
    .form-input { height: 50px; font-size: 14px; }
    .btn-primary { height: 50px; font-size: 14px; }
    .btn-social { height: 48px; font-size: 13px; }
    .form-footer { font-size: 12px; }
}

@media (max-width: 320px) {
    body { padding-top: 65px; }
    .auth-card { padding: 28px 18px; }
    .brand-logo { font-size: 22px; }
    .auth-title { font-size: 18px; }
    .back-btn { top: 14px; left: 14px; padding: 6px 12px; font-size: 11px; }
}

.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 22px;
    flex-wrap: wrap;
    gap: 12px;
}

@media (max-width: 500px) {
    .fp-content { width: 95%; padding: 28px 22px; border-radius: 16px; }
    .fp-content h3 { font-size: 20px; }
    .fp-content p { font-size: 14px; }
    .fp-input { padding: 13px; font-size: 14px; }
    .fp-actions { flex-direction: column; }
    .btn-fp-cancel, .btn-fp-send { padding: 13px; font-size: 14px; }
}

@media (hover: none) and (pointer: coarse) {
    .btn-primary:hover { transform: none; box-shadow: none; }
    .btn-primary:active { transform: scale(0.98); }
    .btn-social:hover { background: rgba(255, 255, 255, 0.04); border-color: var(--input-border); }
    .btn-social:active { background: rgba(255, 255, 255, 0.1); }
    .back-btn:hover { color: rgba(255, 255, 255, 0.6); background: rgba(0, 0, 0, 0.4); transform: none; }
    .back-btn:active { color: white; background: rgba(255, 255, 255, 0.12); }
}

@media (max-height: 600px) and (orientation: landscape) {
    body { align-items: flex-start; padding: 24px 0; }
    .auth-card { padding: 28px 36px; }
    .auth-header { margin-bottom: 18px; }
    .brand-logo { margin-bottom: 14px; }
    .form-group { margin-bottom: 14px; }
    .social-buttons { margin-bottom: 18px; }
    .divider { margin-bottom: 18px; }
    .back-btn { top: 14px; left: 14px; }
}

.fp-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    backdrop-filter: blur(8px);
}

.fp-content {
    background: #151517;
    padding: 36px;
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    width: 90%;
    max-width: 420px;
    text-align: center;
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.6);
}

.fp-content h3 { 
    margin-top: 0; 
    margin-bottom: 12px; 
    color: #fff; 
    font-size: 22px;
    font-weight: 700;
}

.fp-content p { 
    color: #9ca3af; 
    font-size: 15px; 
    margin-bottom: 24px; 
    line-height: 1.6;
}

.fp-input {
    width: 100%;
    background: #000;
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: white;
    padding: 14px 16px;
    border-radius: 12px;
    margin-bottom: 18px;
    font-size: 15px;
    transition: all 0.25s;
}

.fp-input:focus { 
    outline: none; 
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.2);
}

.fp-actions { display: flex; gap: 12px; }

.btn-fp-cancel { 
    flex: 1; 
    background: rgba(255, 255, 255, 0.08);
    color: white; 
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 14px; 
    border-radius: 12px; 
    cursor: pointer; 
    font-weight: 600;
    transition: all 0.25s;
}

.btn-fp-cancel:hover { 
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.2);
}

.btn-fp-send { 
    flex: 1; 
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
    color: white; 
    border: none; 
    padding: 14px; 
    border-radius: 12px; 
    cursor: pointer; 
    font-weight: 700; 
    transition: all 0.25s;
}

.btn-fp-send:hover { 
    transform: translateY(-2px);
    box-shadow: 0 10px 25px rgba(220, 38, 38, 0.35);
}

.fp-message { 
    margin-top: 18px; 
    font-size: 14px; 
    display: none;
    padding: 12px;
    border-radius: 8px;
}

.fp-message.success { 
    color: #4ade80; 
    background: rgba(74, 222, 128, 0.1);
}

.fp-message.error { 
    color: #f87171;
    background: rgba(248, 113, 113, 0.1);
}

.forgot-link {
    color: rgba(255, 255, 255, 0.5);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
    position: relative;
}

.forgot-link:hover { color: var(--accent); }

.forgot-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 1px;
    bottom: -2px;
    left: 0;
    background-color: var(--accent);
    transition: width 0.3s ease;
}

.forgot-link:hover::after { width: 100%; }

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
    color: rgba(255, 255, 255, 0.7);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    user-select: none;
    transition: color 0.25s;
}

.checkbox-wrapper:hover { color: #fff; }

.checkbox-wrapper input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 5px;
    background-color: rgba(0, 0, 0, 0.35);
    cursor: pointer;
    position: relative;
    transition: all 0.25s ease;
    display: grid;
    place-items: center;
}

.checkbox-wrapper input[type="checkbox"]:checked {
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-2) 100%);
    border-color: var(--accent);
}

.checkbox-wrapper input[type="checkbox"]::after {
    content: '';
    width: 5px;
    height: 9px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) scale(0);
    transition: transform 0.2s ease;
    margin-bottom: 2px;
}

.checkbox-wrapper input[type="checkbox"]:checked::after {
    transform: rotate(45deg) scale(1);
}
