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

:root {
    --primary: #6c5ce7;
    --primary-rgb: 108, 92, 231;
    --bg-rgb: 10, 10, 26;
    --accent-2: #fd79a8;
    --primary-light: #a29bfe;
    --primary-dark: #4a3fc7;
    --accent: #00cec9;
    --accent-glow: rgba(0, 206, 201, 0.3);
    --bg-dark: #0a0a1a;
    --bg-card: rgba(18, 18, 40, 0.85);
    --bg-input: rgba(255, 255, 255, 0.05);
    --text: #e8e8f0;
    --text-muted: #8888aa;
    --border: rgba(255, 255, 255, 0.08);
    --danger: #ff6b6b;
    --success: #00b894;
}

body {
    font-family: 'Inter', -apple-system, sans-serif;
    background: var(--bg-dark);
    color: var(--text);
    min-height: 100vh;
    overflow-x: hidden;
}

.auth-container {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 20px;
    position: relative;
}

/* Animated background */
.auth-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.floating-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.4;
    animation: float 20s ease-in-out infinite;
}

.orb-1 {
    width: 400px;
    height: 400px;
    background: var(--primary);
    top: -100px;
    right: -100px;
    animation-delay: 0s;
}

.orb-2 {
    width: 300px;
    height: 300px;
    background: var(--accent);
    bottom: -50px;
    left: -50px;
    animation-delay: -7s;
}

.orb-3 {
    width: 250px;
    height: 250px;
    background: var(--accent-2);
    top: 50%;
    left: 50%;
    animation-delay: -14s;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    25% { transform: translate(50px, -50px) scale(1.1); }
    50% { transform: translate(-30px, 30px) scale(0.95); }
    75% { transform: translate(40px, 20px) scale(1.05); }
}

.grid-overlay {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(var(--primary-rgb), 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(var(--primary-rgb), 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
}

/* Card */
.auth-card {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 440px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 24px;
    padding: 48px 40px;
    backdrop-filter: blur(40px);
    -webkit-backdrop-filter: blur(40px);
    box-shadow:
        0 0 0 1px rgba(var(--primary-rgb), 0.1),
        0 20px 60px rgba(0, 0, 0, 0.5),
        0 0 120px rgba(var(--primary-rgb), 0.08);
    animation: cardEnter 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.register-card {
    max-width: 560px;
}

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

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

.logo-icon {
    width: 62px;
    height: 62px;
    margin: 0 auto 16px;
    /* The Northvault mark carries its own gradient — no tile behind it. */
    background: none;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    filter: drop-shadow(0 8px 26px rgba(var(--primary-rgb), 0.45));
    animation: pulse-glow 3s ease-in-out infinite;
}

@keyframes pulse-glow {
    0%, 100% { box-shadow: 0 8px 32px rgba(var(--primary-rgb), 0.4); }
    50% { box-shadow: 0 8px 48px rgba(var(--primary-rgb), 0.6), 0 0 20px rgba(0, 206, 201, 0.2); }
}

.auth-header h1 {
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.5px;
}

.auth-header h1 span {
    background: linear-gradient(135deg, var(--primary-light), var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.tagline {
    color: var(--text-muted);
    font-size: 14px;
    margin-top: 4px;
    font-weight: 400;
}

/* Form */
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.form-group {
    position: relative;
}

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

.input-wrapper > i:first-child {
    position: absolute;
    left: 16px;
    color: var(--text-muted);
    font-size: 14px;
    transition: color 0.3s;
    z-index: 1;
}

.input-wrapper input,
.input-wrapper select {
    width: 100%;
    padding: 14px 16px 14px 44px;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: 12px;
    color: var(--text);
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    transition: all 0.3s;
    outline: none;
}

.input-wrapper select {
    appearance: none;
    cursor: pointer;
}

.input-wrapper select option {
    background: #1a1a2e;
    color: var(--text);
}

.input-wrapper input:focus,
.input-wrapper select:focus {
    border-color: var(--primary);
    background: rgba(var(--primary-rgb), 0.06);
    box-shadow: 0 0 0 3px rgba(var(--primary-rgb), 0.15);
}

.input-wrapper input:focus + .toggle-pass,
.input-wrapper:focus-within > i:first-child {
    color: var(--primary-light);
}

.input-wrapper input::placeholder {
    color: var(--text-muted);
}

.toggle-pass {
    position: absolute;
    right: 14px;
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    font-size: 14px;
    padding: 4px;
    transition: color 0.3s;
}

.toggle-pass:hover {
    color: var(--primary-light);
}

/* Options */
.form-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
}

.checkbox-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--text-muted);
    user-select: none;
}

.checkbox-wrapper input[type="checkbox"] {
    display: none;
}

.checkmark {
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
    flex-shrink: 0;
}

.checkbox-wrapper input:checked + .checkmark {
    background: var(--primary);
    border-color: var(--primary);
}

.checkbox-wrapper input:checked + .checkmark::after {
    content: '\f00c';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    font-size: 10px;
    color: white;
}

.forgot-link,
.terms-link {
    color: var(--primary-light);
    text-decoration: none;
    transition: color 0.3s;
}

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

/* Alert */
.alert-box {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 500;
    animation: slideDown 0.3s ease;
}

.alert-box.error {
    background: rgba(255, 107, 107, 0.1);
    border: 1px solid rgba(255, 107, 107, 0.3);
    color: var(--danger);
}

.alert-box.info {
    background: rgba(116, 185, 255, 0.1);
    border: 1px solid rgba(116, 185, 255, 0.3);
    color: #74b9ff;
}

.alert-box.success {
    background: rgba(0, 184, 148, 0.1);
    border: 1px solid rgba(0, 184, 148, 0.3);
    color: var(--success);
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Button */
.btn-primary {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    border-radius: 12px;
    color: white;
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
    overflow: hidden;
    margin-top: 4px;
}

.btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent, rgba(255,255,255,0.1), transparent);
    transform: translateX(-100%);
    transition: transform 0.5s;
}

.btn-primary:hover::before {
    transform: translateX(100%);
}

.btn-primary:hover {
    box-shadow: 0 8px 32px rgba(var(--primary-rgb), 0.4);
    transform: translateY(-1px);
}

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

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

.btn-loader {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

/* Footer */
.auth-footer {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: var(--text-muted);
}

.auth-footer a {
    color: var(--primary-light);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s;
}

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

/* Security badge */
.security-badge {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 12px;
}

.security-badge i {
    color: var(--accent);
}

/* Responsive */
@media (max-width: 600px) {
    .auth-card {
        padding: 32px 24px;
        border-radius: 20px;
    }

    .form-row {
        grid-template-columns: 1fr;
    }

    .auth-header h1 {
        font-size: 24px;
    }
}
