/* Premium Signup Form Styling */
:root {
    /* Color Palette */
    --primary-hue: 250;
    --primary: hsl(var(--primary-hue), 80%, 65%);
    --primary-dark: hsl(var(--primary-hue), 80%, 55%);
    --secondary: hsl(300, 80%, 65%);
    --surface: rgba(255, 255, 255, 0.1);
    --surface-border: rgba(255, 255, 255, 0.2);
    --text-main: #ffffff;
    --text-muted: rgba(255, 255, 255, 0.7);
    --error: #ff6b6b;
    --success: #51cf66;
    --bg-dark: #0f0c29;

    /* Spacing & Layout */
    --radius-lg: 24px;
    --radius-md: 12px;
    --radius-sm: 8px;
    --spacing-xs: 8px;
    --spacing-sm: 16px;
    --spacing-md: 24px;
    --spacing-lg: 32px;

    /* Transitions */
    --ease-elastic: cubic-bezier(0.68, -0.55, 0.265, 1.55);
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
}

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

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

/* Animated Background */
.background-animation {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: radial-gradient(circle at 10% 20%, rgba(100, 50, 255, 0.4) 0%, transparent 40%),
        radial-gradient(circle at 90% 80%, rgba(200, 50, 150, 0.4) 0%, transparent 40%),
        radial-gradient(circle at 50% 50%, rgba(50, 100, 255, 0.2) 0%, transparent 60%);
    filter: blur(60px);
    animation: pulseBg 10s ease-in-out infinite alternate;
}

@keyframes pulseBg {
    0% {
        transform: scale(1);
    }

    100% {
        transform: scale(1.1);
    }
}

/* Container */
.container {
    width: 100%;
    max-width: 480px;
    padding: var(--spacing-sm);
    perspective: 1000px;
}

/* Glassmorphism Card */
.form-card {
    background: var(--surface);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--surface-border);
    border-radius: var(--radius-lg);
    padding: 40px var(--spacing-lg);
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    transform-style: preserve-3d;
    animation: cardEntrance 0.8s var(--ease-elastic) backwards;
}

@keyframes cardEntrance {
    0% {
        opacity: 0;
        transform: translateY(50px) rotateX(-10deg);
    }

    100% {
        opacity: 1;
        transform: translateY(0) rotateX(0);
    }
}

.form-header {
    text-align: center;
    margin-bottom: var(--spacing-lg);
}

.form-header h1 {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: var(--spacing-xs);
    background: linear-gradient(135deg, #fff 0%, #aaa 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.form-header p {
    color: var(--text-muted);
}

/* Form Groups */
.form-group {
    margin-bottom: var(--spacing-md);
    position: relative;
}

.input-wrapper {
    position: relative;
}

/* Inputs */
input {
    width: 100%;
    padding: 16px;
    background: rgba(0, 0, 0, 0.2);
    border: 2px solid transparent;
    border-radius: var(--radius-md);
    color: var(--text-main);
    font-size: 1rem;
    font-family: inherit;
    transition: all var(--transition-normal);
}

input:focus {
    outline: none;
    background: rgba(0, 0, 0, 0.3);
    border-color: var(--primary);
    box-shadow: 0 0 15px rgba(100, 50, 255, 0.3);
}

/* Floating Labels */
label {
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    transition: all var(--transition-fast);
    padding: 0 4px;
}

input:focus~label,
input:not(:placeholder-shown)~label {
    top: 0;
    left: 12px;
    font-size: 0.8rem;
    /* Solid background matching the visual glass color to hide the border */
    background: #27243E;
    padding: 0 6px;
    color: var(--primary);
    font-weight: 500;
    z-index: 10;
}

/* Validation Styles */
input.valid {
    border-color: var(--success);
}

input.valid:focus {
    box-shadow: 0 0 15px rgba(81, 207, 102, 0.3);
}

input.invalid {
    border-color: var(--error);
    animation: shake 0.4s var(--ease-elastic);
}

input.invalid:focus {
    box-shadow: 0 0 15px rgba(255, 107, 107, 0.3);
}

@keyframes shake {

    0%,
    100% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-5px);
    }

    75% {
        transform: translateX(5px);
    }
}

/* Error Messages */
.error-msg {
    display: block;
    color: var(--error);
    font-size: 0.85rem;
    margin-top: 6px;
    min-height: 20px;
    opacity: 0;
    transform: translateY(-5px);
    transition: all var(--transition-fast);
}

input.invalid~.error-msg,
.form-group.error .error-msg {
    opacity: 1;
    transform: translateY(0);
}

/* Password Toggle */
.toggle-password {
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    transition: color var(--transition-fast);
    display: flex;
    align-items: center;
}

.toggle-password:hover {
    color: var(--text-main);
}

/* Password Requirements */
.password-requirements {
    list-style: none;
    margin-top: 8px;
    font-size: 0.8rem;
    color: var(--text-muted);
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4px;
    padding-left: 4px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    transition: all 0.4s ease;
}

input#password:focus~.password-requirements,
input#password:not(:placeholder-shown)~.password-requirements {
    max-height: 100px;
    opacity: 1;
    margin-top: 12px;
}

.password-requirements li {
    display: flex;
    align-items: center;
    gap: 6px;
    opacity: 0.6;
    transition: all 0.2s;
}

.password-requirements li::before {
    content: "○";
    font-size: 10px;
}

.password-requirements li.met {
    color: var(--success);
    opacity: 1;
}

.password-requirements li.met::before {
    content: "●";
}

/* Submit Button */
button[type="submit"] {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: var(--radius-md);
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: white;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    position: relative;
    overflow: hidden;
}

button[type="submit"]:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.3);
}

button[type="submit"]:active {
    transform: translateY(0);
}

button[type="submit"]:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Loader */
.loader {
    display: none;
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 1s ease-in-out infinite;
    position: absolute;
    top: calc(50% - 10px);
    left: calc(50% - 10px);
}

button[type="submit"].loading .btn-text {
    visibility: hidden;
}

button[type="submit"].loading .loader {
    display: block;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Footer */
.form-footer {
    text-align: center;
    margin-top: var(--spacing-md);
    font-size: 0.9rem;
    color: var(--text-muted);
}

.form-footer a {
    color: var(--primary);
    text-decoration: none;
    font-weight: 500;
}

.form-footer a:hover {
    text-decoration: underline;
}

/* Modal */
.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.3s;
}

.modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background: #1a1a2e;
    padding: 40px;
    border-radius: var(--radius-lg);
    text-align: center;
    max-width: 400px;
    width: 90%;
    border: 1px solid var(--surface-border);
    transform: scale(1);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.modal.hidden .modal-content {
    transform: scale(0.8);
}

.success-icon {
    width: 80px;
    height: 80px;
    background: rgba(81, 207, 102, 0.2);
    color: var(--success);
    margin: 0 auto 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-content h2 {
    margin-bottom: 10px;
}

.btn-secondary {
    background: transparent;
    border: 1px solid var(--surface-border);
    color: #fff;
    padding: 10px 20px;
    margin-top: 20px;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
}

/* Responsive */
@media (max-width: 480px) {
    .form-card {
        padding: 30px 20px;
    }
}