/* ================= VARIABLES ================= */
:root {
    --primary: #00e676; 
    --primary-glow: rgba(0, 230, 118, 0.4);
    --accent: #ff3d00; 
    --warning: #ffb74d;
    --bg-dark: #050505;
    --surface: rgba(30, 30, 35, 0.7);
    --surface-solid: #1e1e23;
    --glass-border: rgba(255, 255, 255, 0.1);
    --text-main: #ffffff;
    --text-muted: #a0a0a0;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --radius: 16px;
}

/* ================= UTILITIES (CSP COMPLIANCE) ================= */
.hidden { display: none !important; }
.block { display: block !important; }
.flex { display: flex !important; }
.text-primary { color: var(--primary) !important; }
.w-100 { width: 100%; }
.mb-10 { margin-bottom: 10px; }
.disabled { opacity: 0.5; pointer-events: none; }

/* ================= RESET & BODY ================= */
* { box-sizing: border-box; margin: 0; padding: 0; }

body {
    font-family: "Outfit", sans-serif;
    background-color: var(--bg-dark);
    background-image: 
        radial-gradient(circle at 10% 20%, rgba(0, 230, 118, 0.08) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(41, 98, 255, 0.08) 0%, transparent 40%);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

/* ================= CONTAINER CARD ================= */
.login-container {
    background: var(--surface);
    backdrop-filter: blur(12px);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius);
    padding: 40px;
    width: 100%;
    max-width: 450px;
    box-shadow: 0 25px 50px -12px rgba(0,0,0,0.5);
    animation: slideUp 0.4s ease-out;
    position: relative;
    overflow: hidden;
}

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

/* ================= HEADER & LOGO ================= */
.logo {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none;
    margin-bottom: 30px;
    font-size: 1.8rem;
    font-weight: 800;
}

.logo i { color: var(--primary); }
.logo span {
    background: linear-gradient(90deg, #fff, var(--primary));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}
.logo-img { height: 40px; width: auto; }

.login-header { text-align: center; margin-bottom: 30px; }
.login-header h1 { font-size: 1.5rem; font-weight: 600; margin-bottom: 5px; }
.login-header p { color: var(--text-muted); font-size: 0.9rem; }

/* ================= FORM ELEMENTS ================= */
.form-group { margin-bottom: 20px; position: relative; }

label {
    display: block; margin-bottom: 8px; color: var(--text-muted);
    font-size: 0.8rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px;
}

.input-with-icon { position: relative; }

.input-with-icon i {
    position: absolute; left: 15px; top: 50%; transform: translateY(-50%);
    color: var(--text-muted); font-size: 0.9rem; transition: var(--transition); z-index: 2;
}

.form-control {
    width: 100%;
    background: rgba(0,0,0,0.3);
    border: 1px solid var(--glass-border);
    color: #fff;
    padding: 14px 14px 14px 45px; 
    border-radius: 8px;
    font-family: "JetBrains Mono", monospace;
    font-size: 0.9rem;
    transition: var(--transition);
}

.form-control:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 230, 118, 0.1); background: rgba(0,0,0,0.5);
}

.form-control:focus + i, .input-with-icon:focus-within i { color: var(--primary); }

/* ================= SECURITY & CAPTCHA ================= */
.website-url-field { opacity: 0; position: absolute; top: 0; left: 0; height: 0; width: 0; z-index: -1; }

.captcha-container {
    display: flex; align-items: center; gap: 10px;
    background: rgba(0,0,0,0.2); padding: 10px; border-radius: 8px;
    border: 1px solid var(--glass-border);
}
.captcha-img { border-radius: 4px; height: 50px; cursor: pointer; border: 1px solid rgba(255,255,255,0.1); }
.captcha-input {
    width: 100%; background: transparent; border: none; color: white;
    font-family: "JetBrains Mono", monospace; font-size: 1rem; padding: 5px;
}
.captcha-input:focus { outline: none; }
.captcha-refresh { font-size: 0.8rem; color: var(--text-muted); cursor: pointer; }
.captcha-refresh:hover { color: var(--primary); }

/* ================= LINKS & BUTTONS ================= */
.terms-group { font-size: 0.85rem; color: var(--text-muted); }
.terms-label { text-transform: none; font-weight: 400; cursor: pointer; }
.terms-checkbox { margin-right: 5px; accent-color: var(--primary); cursor: pointer; }
.terms-link { color: var(--primary); text-decoration: none; font-weight: 500; }
.terms-link:hover { text-decoration: underline; }

.forgot-password {
    display: block; text-align: center; margin-top: 15px; color: var(--text-muted);
    font-size: 0.85rem; text-decoration: none; transition: var(--transition);
}
.forgot-password:hover { color: #fff; }

.login-button {
    width: 100%; background: var(--primary); color: #000; border: none; padding: 14px;
    border-radius: 50px; font-weight: 700; font-family: "Outfit", sans-serif;
    font-size: 1rem; cursor: pointer; transition: var(--transition); margin-top: 10px;
}
.login-button:hover { transform: translateY(-2px); box-shadow: 0 0 20px var(--primary-glow); }

.signup-link {
    text-align: center; margin-top: 25px; padding-top: 20px;
    border-top: 1px solid var(--glass-border); color: var(--text-muted); font-size: 0.9rem;
}
.signup-link a { color: #fff; font-weight: 600; text-decoration: none; margin-left: 5px; }
.signup-link a:hover { color: var(--primary); }

/* ================= MESSAGES & VALIDATION ================= */
.error-message, .success-message {
    padding: 12px; border-radius: 8px; font-size: 0.85rem; margin-bottom: 20px; text-align: center;
}
.error-message { background: rgba(255, 61, 0, 0.1); border: 1px solid rgba(255, 61, 0, 0.3); color: #ff5252; }
.success-message { background: rgba(0, 230, 118, 0.1); border: 1px solid rgba(0, 230, 118, 0.3); color: var(--primary); }

.username-requirements, .password-requirements {
    margin-top: 8px; background: rgba(255,255,255,0.03); padding: 10px;
    border-radius: 6px; font-size: 0.75rem;
}
.username-requirements ul, .password-requirements ul { list-style: none; padding-left: 5px; }
.username-requirements li, .password-requirements li {
    margin-bottom: 4px; display: flex; align-items: center; gap: 8px; color: #666; transition: var(--transition);
}
li.invalid::before { content: '\f00d'; font-family: "Font Awesome 7 Free"; font-weight: 900; color: #555; }
li.valid { color: var(--text-muted); }
li.valid::before { content: '\f00c'; font-family: "Font Awesome 7 Free"; font-weight: 900; color: var(--primary); }

/* ================= MODAL STYLES ================= */
.modal-overlay {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.85); backdrop-filter: blur(8px);
    z-index: 1000; justify-content: center; align-items: center; display: flex;
    animation: fadeIn 0.3s ease;
}
.modal-overlay.hidden { display: none !important; }

.modal-card {
    background: var(--surface-solid); border: 1px solid var(--warning);
    width: 90%; max-width: 450px; padding: 30px; border-radius: var(--radius);
    box-shadow: 0 0 50px rgba(255, 183, 77, 0.1); text-align: center;
    position: relative; animation: scaleIn 0.3s cubic-bezier(0.18, 0.89, 0.32, 1.28);
}
.modal-success-border { border-color: var(--primary); }

.modal-icon { font-size: 3rem; color: var(--warning); margin-bottom: 15px; }
.modal-title { color: #fff; font-size: 1.4rem; font-weight: 700; margin-bottom: 15px; }
.modal-body { color: var(--text-muted); font-size: 0.95rem; line-height: 1.6; margin-bottom: 25px; }
.modal-body strong { color: #fff; }
.modal-secondary-text { font-size: 0.9rem; color: #aaa; }

.modal-checkbox-wrapper {
    background: rgba(255,255,255,0.05); padding: 15px; border-radius: 8px;
    margin-bottom: 25px; text-align: left; display: flex; gap: 12px; align-items: flex-start;
    border: 1px solid var(--glass-border);
}
.modal-checkbox-wrapper input { margin-top: 4px; transform: scale(1.2); }
.modal-checkbox-wrapper span { font-size: 0.9rem; color: #fff; }

.modal-actions { display: flex; gap: 10px; justify-content: space-between; }
.column-actions { flex-direction: column; }

.modal-btn {
    padding: 12px 20px; border-radius: 50px; border: none; font-weight: 600;
    cursor: pointer; transition: var(--transition); font-family: "Outfit", sans-serif;
}
.modal-btn.secondary { background: transparent; color: var(--text-muted); border: 1px solid #333; }
.modal-btn.secondary:hover { color: #fff; border-color: #666; }

.modal-btn.primary { background: var(--primary); color: #000; flex-grow: 1; }
.modal-btn.primary.active { opacity: 1; pointer-events: all; box-shadow: 0 0 20px var(--primary-glow); }

.key-display-box {
    background: rgba(0, 230, 118, 0.1); border: 1px dashed var(--primary);
    color: var(--primary); padding: 15px; border-radius: 8px;
    font-family: "JetBrains Mono", monospace; font-size: 1.1rem; letter-spacing: 1px;
    margin: 20px 0; word-break: break-all; user-select: all; font-weight: bold;
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes scaleIn { from { transform: scale(0.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }