@import url('https://fonts.googleapis.com/css2?family=Poppins:wght@400;600&display=swap');

/* === Variables: Dark Theme Palette === */
:root {
    --bg-dark: #121212;
    --card-bg: #1f1f1f;   /* Matches the 'mask' color for floating labels */
    --input-bg: #2b2b2b;
    --border-color: #444;
    
    --gold: #ffcc00;
    --gold-hover: #e6b800;
    
    --text-main: #e0e0e0;
    --text-muted: #aaaaaa;
    
    --shadow-soft: 0 10px 30px rgba(0,0,0,0.5);
    --shadow-glow: 0 0 8px rgba(255, 204, 0, 0.2);
}

/* === Base Layout === */
body {
    background-color: var(--bg-dark);
    color: var(--text-main);
    font-family: 'Poppins', sans-serif;
    margin: 0;
    line-height: 1.6;
}

/* === Card Container === */
.form-container {
    background-color: var(--card-bg);
    padding: 3rem;
    border-radius: 12px;
    border: 1px solid #333;
    width: 100%;
    max-width: 600px;
    margin: auto;
    box-shadow: var(--shadow-soft);
}

.form-title {
    color: var(--gold);
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 2rem;
}

.text-muted {
    color: var(--text-muted) !important;
}

/* === Inputs & Selects (Global Style) === */
.form-control, 
.form-select {
    background-color: var(--input-bg) !important;
    border: 1px solid var(--border-color);
    color: #fff !important;
    border-radius: 6px;
}

.form-control:focus, 
.form-select:focus {
    border-color: var(--gold);
    box-shadow: var(--shadow-glow);
    background-color: var(--input-bg) !important;
    outline: none;
}

/* === Floating Labels (The Magic Fix) === */
.form-floating {
    position: relative;
    margin-bottom: 1.5rem;
}

.form-floating > .form-control,
.form-floating > .form-select {
    height: 58px; /* Standard fixed height */
    padding-top: 1.625rem;
    padding-bottom: 0.625rem;
}

.form-floating > label {
    color: var(--text-muted);
    padding: 1rem 0.75rem;
    pointer-events: none; /* Click-through */
    transform-origin: 0 0;
    transition: opacity .1s ease-in-out, transform .1s ease-in-out;
}

/* Active State: Input Focused OR Has Value */
.form-floating > .form-control:focus ~ label,
.form-floating > .form-control:not(:placeholder-shown) ~ label,
.form-floating > .form-select ~ label {
    color: var(--gold) !important;
    background-color: var(--card-bg) !important; /* Critical: Matches card bg to hide line */
    
    /* Geometry Fixes */
    padding: 0 5px;       /* Tight padding */
    line-height: 1.2;     /* Prevent height bloat */
    height: auto;         /* Allow shrinking */
    
    /* Position Fix */
    transform: scale(0.85) translateY(-1.1rem) translateX(0.15rem);
    
    border-radius: 4px;
    z-index: 5; /* Sits on top of border */
    opacity: 1;
}

/* === Input Groups (Phone/OTP) === */
.input-group {
    display: flex;
}

.input-group .form-control,
.input-group .form-select {
    border-radius: 0; 
}
.input-group :first-child { border-top-left-radius: 6px; border-bottom-left-radius: 6px; }
.input-group :last-child { border-top-right-radius: 6px; border-bottom-right-radius: 6px; }

/* === Buttons === */
.btn-gold {
    background-color: var(--gold);
    color: #000;
    font-weight: 700;
    text-transform: uppercase;
    border: none;
    border-radius: 6px;
    padding: 12px;
    width: 100%;
    transition: all 0.3s ease;
    cursor: pointer;
}

.btn-gold:hover {
    background-color: var(--gold-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 204, 0, 0.3);
}

.btn-gold:disabled {
    background-color: #444;
    color: #888;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Secondary/Action Buttons inside inputs */
.btn-secondary, .btn-verify {
    background-color: #333;
    color: #fff;
    border: 1px solid var(--border-color);
    padding: 0 15px;
    font-size: 0.9rem;
    transition: 0.3s;
    cursor: pointer;
}
.btn-secondary:hover, .btn-verify:hover {
    border-color: var(--gold);
    color: var(--gold);
}

/* === Utilities === */
/* Browser Autofill Fix (Forces dark theme) */
input:-webkit-autofill,
textarea:-webkit-autofill,
select:-webkit-autofill {
    -webkit-text-fill-color: #fff !important;
    -webkit-box-shadow: 0 0 0px 1000px var(--input-bg) inset !important;
    transition: background-color 5000s ease-in-out 0s;
}

/* Verified Badge */
.verified-badge {
    color: #28a745;
    font-size: 0.85rem;
    font-weight: 600;
    margin-top: 5px;
    display: none; /* Hidden by default */
}

/* Responsive */
@media (max-width: 768px) {
    .form-container {
        padding: 2rem;
        width: 95%;
    }
}