/* Custom Scrollbars */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
::-webkit-scrollbar-track {
    background: #0F1419;
}
::-webkit-scrollbar-thumb {
    background: rgba(159, 232, 112, 0.25);
    border-radius: 6px;
    border: 2px solid #0F1419;
}
::-webkit-scrollbar-thumb:hover {
    background: #9FE870;
}

:root {
    --primary-green: #769E5C;
    --accent-green: #597745;
    --light-green: #8DB470;
    --neon-green: #9FE870;
    --dark-bg: #0F1419;
    --dark-surface: #1A1F26;
    --dark-elevated: #242B33;
    --text-primary: #FFFFFF;
    --text-secondary: #A0A9B8;
    --border-dark: rgba(159, 232, 112, 0.2);
}

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

body {
    font-family: "Montserrat", -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--dark-bg);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}

/* ===== BACKGROUND EFFECTS ===== */
.auth-bg-pattern {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        linear-gradient(rgba(159, 232, 112, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(159, 232, 112, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    animation: patternDrift 25s linear infinite;
    z-index: -2;
}

@keyframes patternDrift {
    0% { transform: translate(0, 0); }
    100% { transform: translate(60px, 60px); }
}

.floating-orb {
    position: fixed;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-green), var(--neon-green));
    opacity: 0.08;
    animation: floatOrb 8s ease-in-out infinite;
    z-index: -1;
}

.floating-orb:nth-child(1) {
    width: 150px;
    height: 150px;
    top: 10%;
    right: 15%;
    animation-delay: 0s;
}

.floating-orb:nth-child(2) {
    width: 100px;
    height: 100px;
    top: 70%;
    left: 10%;
    animation-delay: 3s;
}

.floating-orb:nth-child(3) {
    width: 80px;
    height: 80px;
    bottom: 20%;
    right: 25%;
    animation-delay: 6s;
}

@keyframes floatOrb {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-30px) rotate(180deg); }
}

/* ===== MAIN CONTAINER ===== */
.auth-container {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    position: relative;
    z-index: 1;
}

.auth-card {
    background: linear-gradient(135deg, var(--dark-surface), var(--dark-elevated));
    border-radius: 24px;
    padding: 3rem;
    border: 1px solid var(--border-dark);
    backdrop-filter: blur(20px);
    box-shadow: 
        0 20px 40px rgba(0, 0, 0, 0.4),
        0 0 60px rgba(159, 232, 112, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
    position: relative;
    overflow: hidden;
    width: 100%;
    max-width: 420px;
    animation: cardAppear 0.8s ease forwards;
}

@keyframes cardAppear {
    from {
        opacity: 0;
        transform: translateY(30px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary-green), var(--neon-green));
}

.auth-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(159, 232, 112, 0.05) 0%, transparent 50%);
    pointer-events: none;
}

/* ===== LOGO ===== */
.auth-logo {
    text-align: center;
    margin-bottom: 2rem;
}

.auth-logo a {
    text-decoration: none;
    display: inline-block;
    transition: all 0.3s ease;
}

.auth-logo a:hover {
    transform: translateY(-3px);
    filter: drop-shadow(0 8px 25px rgba(159, 232, 112, 0.4));
}

.logo-title {
    font-size: 2.2rem;
    font-weight: 900;
    letter-spacing: -1px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: logoGlow 3s ease-in-out infinite alternate;
}

.auth-logo i {
  font-size: 2.1rem;
  color: var(--neon-green) !important;
  margin-right: 0.25rem;
  animation: logoGlow 4s ease-in-out infinite alternate;
}

@keyframes logoGlow {
  from { filter: drop-shadow(0 0 5px rgba(159, 232, 112, 0.3)); }
  to { filter: drop-shadow(0 0 15px rgba(159, 232, 112, 0.6)); }
}

.logo-name {
  font-family: 'Montserrat', sans-serif !important;
  font-weight: 900 !important;
  font-size: 2.2rem;
  letter-spacing: -0.5px;
  background: linear-gradient(135deg, #FFFFFF 0%, var(--neon-green) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  display: inline-block;
}

@keyframes iconSpin {
    0%, 100% { transform: rotate(0deg); }
    50% { transform: rotate(10deg); }
}

/* ===== FORM STYLES ===== */
.auth-title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 2rem;
    text-align: center;
    position: relative;
}

.form-floating {
    position: relative;
    margin-bottom: 1.5rem;
    transition: transform 0.3s ease;
}

.form-control {
    width: 100%;
    background: rgba(36, 43, 51, 0.8);
    border: 2px solid var(--border-dark);
    border-radius: 16px;
    padding: 1.25rem 1rem 0.75rem 3rem;
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 500;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    backdrop-filter: blur(10px);
}

.form-control:focus {
    border-color: var(--neon-green);
    box-shadow: 
        0 0 0 3px rgba(159, 232, 112, 0.15),
        0 8px 25px rgba(159, 232, 112, 0.2);
    background: rgba(36, 43, 51, 0.9);
}

.form-control::placeholder {
    color: transparent;
}

.form-label {
    position: absolute;
    top: 50%;
    left: 3rem;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    background: transparent;
    padding: 0 0.5rem;
    font-size: 1rem;
    z-index: 5;
}

.form-control:focus + .form-label,
.form-control:not(:placeholder-shown) + .form-label {
    top: 0;
    left: 2.5rem;
    font-size: 0.85rem;
    color: var(--neon-green);
    background: linear-gradient(to right, transparent, var(--dark-elevated) 6px, var(--dark-elevated) calc(100% - 6px), transparent);
    font-weight: 600;
    z-index: 5;
}

.input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    font-size: 1.1rem;
    transition: all 0.3s ease;
    z-index: 2;
}

.form-control:focus ~ .input-icon {
    color: var(--neon-green);
    transform: translateY(-50%) scale(1.1);
}

/* ===== BUTTONS ===== */
.btn-auth-primary {
    width: 100%;
    background: linear-gradient(135deg, var(--primary-green), var(--neon-green));
    border: none;
    border-radius: 16px;
    padding: 1rem 2rem;
    color: var(--dark-bg);
    font-weight: 700;
    font-size: 1.1rem;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
    margin-bottom: 1rem;
    cursor: pointer;
    box-shadow: 0 8px 25px rgba(118, 158, 92, 0.4);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.btn-auth-primary::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.6s;
}

.btn-auth-primary:hover::before {
    left: 100%;
}

.btn-auth-primary:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 40px rgba(159, 232, 112, 0.6);
}

.btn-auth-primary:active {
    transform: translateY(-1px);
}

/* ===== COPYRIGHT ===== */
.copyright {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.85rem;
    font-weight: 500;
    margin-top: 2rem;
    opacity: 0.8;
}

/* ===== LOADING STATE ===== */
.btn-loading {
    pointer-events: none;
    opacity: 0.7;
}

.btn-loading::after {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top-color: currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    display: inline-block;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .auth-container {
        padding: 1rem;
    }
    
    .auth-card {
        padding: 2rem;
        border-radius: 20px;
    }
    
    .logo-title {
        font-size: 2.0rem;
    }
    
    .auth-title {
        font-size: 1.3rem;
    }
    
    .form-control {
        padding: 1rem 0.875rem 0.625rem 2.5rem;
    }
    
    .form-label {
        left: 2.5rem;
    }
    
    .input-icon {
        left: 0.875rem;
    }
}

/* ===== ANIMATIONS ===== */
.fade-in {
    opacity: 0;
    animation: fadeIn 0.8s ease forwards;
}

.fade-in:nth-child(1) { animation-delay: 0.1s; }
.fade-in:nth-child(2) { animation-delay: 0.2s; }
.fade-in:nth-child(3) { animation-delay: 0.3s; }
.fade-in:nth-child(4) { animation-delay: 0.4s; }

@keyframes fadeIn {
    to { opacity: 1; }
}

/* ===== INLINE ALERTS ===== */
.alert-container {
    position: fixed;
    top: 1.25rem;
    left: 50%;
    transform: translateX(-50%);
    width: min(92vw, 460px);
    margin: 0;
    z-index: 10050;
    pointer-events: none;
}

.inline-alert {
    width: 100%;
    margin: 0 0 0.75rem;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 12px;
    background: rgba(18, 24, 30, 0.94);
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.35), 0 0 0 1px rgba(255, 255, 255, 0.03);
    backdrop-filter: blur(18px);
    transform: translateY(-12px) scale(0.98);
    opacity: 0;
    pointer-events: auto;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.inline-alert.show {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.inline-alert.hide {
    transform: translateY(-12px) scale(0.98);
    opacity: 0;
    max-height: 0;
    margin-bottom: 0;
}

.inline-alert::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.035), transparent 60%);
    pointer-events: none;
}

.inline-alert::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 3px;
    border-radius: 12px 12px 0 0;
}

.inline-alert.alert-error::after { 
    background: linear-gradient(90deg, #ef4444, #fb7185); 
}

.alert-header {
    display: flex;
    align-items: center;
    gap: 0.875rem;
    padding: 1rem 1rem 1rem 0.95rem;
}

.alert-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    flex-shrink: 0;
    background: rgba(244, 67, 54, 0.15);
    color: #f44336;
    border: 1px solid rgba(244, 67, 54, 0.3);
}

.alert-content {
    flex: 1;
    min-width: 0;
}

.alert-title {
    font-size: 0.95rem;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 0.2rem;
    line-height: 1.3;
}

.alert-message {
    font-size: 0.86rem;
    color: var(--text-secondary);
    line-height: 1.45;
    margin: 0;
}

.alert-close {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.06);
    color: var(--text-secondary);
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.3s ease;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 0.25rem;
    flex-shrink: 0;
}

.alert-close:hover {
    background: rgba(255, 255, 255, 0.1);
    color: var(--text-primary);
}
