/* ============================================
   AUREUS GYM – Web Registration Form
   Mobile-first, Dark Theme
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

:root {
    --bg: #000000;
    --surface: #0A0A0A;
    --card: #111111;
    --card-border: #1E1E1E;
    --input-bg: #0D0D0D;
    --input-border: #2A2A2A;
    --input-focus: #7B61FF;
    --primary: #7B61FF;
    --primary-glow: rgba(123, 97, 255, 0.25);
    --gold: #FFD700;
    --gold-glow: rgba(255, 215, 0, 0.15);
    --success: #10B981;
    --success-glow: rgba(16, 185, 129, 0.2);
    --error: #EF4444;
    --error-glow: rgba(239, 68, 68, 0.15);
    --text: #FFFFFF;
    --text-secondary: #A0A0A0;
    --text-dim: #666666;
    --radius: 14px;
    --radius-sm: 10px;
    --font: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
}

/* ---- Loading Screen ---- */
#loading-screen {
    position: fixed;
    inset: 0;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

#loading-screen.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.loader-ring {
    width: 48px;
    height: 48px;
    border: 3px solid var(--card-border);
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.loader-text {
    margin-top: 16px;
    color: var(--text-dim);
    font-size: 0.85rem;
    letter-spacing: 0.5px;
}

/* ---- Error Screen ---- */
#error-screen {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--bg);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    padding: 32px;
    text-align: center;
}

#error-screen.visible {
    display: flex;
}

.error-icon {
    font-size: 48px;
    margin-bottom: 16px;
}

.error-title {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.error-message {
    color: var(--text-dim);
    font-size: 0.9rem;
    max-width: 320px;
}

/* ---- Success Screen ---- */
#success-screen {
    display: none;
    position: fixed;
    inset: 0;
    background: var(--bg);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    padding: 32px;
    text-align: center;
}

#success-screen.visible {
    display: flex;
}

.success-checkmark {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--success-glow);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 24px;
    animation: popIn 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.success-checkmark svg {
    width: 40px;
    height: 40px;
    stroke: var(--success);
    stroke-width: 2.5;
    fill: none;
}

@keyframes popIn {
    0% {
        transform: scale(0);
        opacity: 0;
    }

    100% {
        transform: scale(1);
        opacity: 1;
    }
}

.success-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
}

.success-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 32px;
    max-width: 300px;
}

.success-info {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 20px 24px;
    max-width: 340px;
    width: 100%;
}

.success-info-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 0;
}

.success-info-row:not(:last-child) {
    border-bottom: 1px solid var(--card-border);
}

.success-info-icon {
    font-size: 1.25rem;
}

.success-info-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* ---- Main Container ---- */
.app-container {
    max-width: 480px;
    margin: 0 auto;
    padding: 0 20px 40px;
    min-height: 100vh;
}

/* ---- Header ---- */
.gym-header {
    text-align: center;
    padding: 32px 0 24px;
}

.gym-logo {
    width: 72px;
    height: 72px;
    border-radius: 18px;
    object-fit: cover;
    border: 2px solid var(--card-border);
    margin-bottom: 12px;
    background: var(--card);
}

.gym-logo.placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    font-weight: 800;
    color: var(--primary);
    background: linear-gradient(135deg, var(--card), #1a1a2e);
}

.gym-name {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 4px;
}

.gym-tagline {
    color: var(--text-dim);
    font-size: 0.82rem;
    letter-spacing: 0.3px;
}

/* ---- Section ---- */
.form-section {
    margin-bottom: 24px;
}

.section-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1.2px;
    color: var(--text-dim);
    margin-bottom: 12px;
    padding-left: 4px;
}

/* ---- Form Cards ---- */
.form-card {
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 12px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

/* ---- Input Groups ---- */
.input-group {
    margin-bottom: 12px;
}

.input-group:last-child {
    margin-bottom: 0;
}

.input-label {
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: 6px;
    display: flex;
    align-items: center;
    gap: 4px;
}

.input-label .required {
    color: var(--primary);
    font-weight: 700;
}

.input-wrapper {
    position: relative;
}

.input-field {
    width: 100%;
    background: var(--input-bg);
    border: 1.5px solid var(--input-border);
    border-radius: var(--radius-sm);
    padding: 13px 16px;
    font-size: 0.95rem;
    color: var(--text);
    font-family: var(--font);
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
    outline: none;
    appearance: none;
    -webkit-appearance: none;
}

.input-field::placeholder {
    color: var(--text-dim);
}

.input-field:focus {
    border-color: var(--input-focus);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

.input-field.error {
    border-color: var(--error);
    box-shadow: 0 0 0 3px var(--error-glow);
}

.input-row {
    display: flex;
    gap: 10px;
}

.input-row .input-group {
    flex: 1;
}

textarea.input-field {
    resize: vertical;
    min-height: 80px;
}

/* ---- OTP Section ---- */
.otp-row {
    display: flex;
    gap: 10px;
    align-items: flex-start;
}

.otp-row .input-group {
    flex: 1;
}

.otp-btn {
    flex-shrink: 0;
    height: 46px;
    margin-top: 24px;
    padding: 0 16px;
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.8rem;
    font-weight: 600;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
}

.otp-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.otp-btn:not(:disabled):active {
    transform: scale(0.96);
}

.otp-verified {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--success);
    font-size: 0.8rem;
    font-weight: 600;
    margin-top: 4px;
}

/* ---- Plan Cards ---- */
.plans-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.plan-card {
    background: var(--input-bg);
    border: 1.5px solid var(--input-border);
    border-radius: var(--radius-sm);
    padding: 16px;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    gap: 14px;
    user-select: none;
    -webkit-user-select: none;
}

.plan-card:active {
    transform: scale(0.985);
}

.plan-card.selected {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
    background: rgba(123, 97, 255, 0.06);
}

.plan-radio {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid var(--input-border);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.plan-card.selected .plan-radio {
    border-color: var(--primary);
}

.plan-radio-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--primary);
    transform: scale(0);
    transition: transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.plan-card.selected .plan-radio-dot {
    transform: scale(1);
}

.plan-info {
    flex: 1;
}

.plan-name {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 2px;
}

.plan-duration {
    font-size: 0.78rem;
    color: var(--text-dim);
}

.plan-price {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
}

/* ---- File Upload ---- */
.file-upload {
    border: 2px dashed var(--input-border);
    border-radius: var(--radius-sm);
    padding: 24px;
    text-align: center;
    cursor: pointer;
    transition: all 0.25s ease;
}

.file-upload:active {
    transform: scale(0.98);
}

.file-upload.has-file {
    border-color: var(--success);
    border-style: solid;
    background: var(--success-glow);
}

.file-upload-icon {
    font-size: 28px;
    margin-bottom: 8px;
}

.file-upload-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.file-upload-hint {
    font-size: 0.75rem;
    color: var(--text-dim);
    margin-top: 4px;
}

.file-upload input[type="file"] {
    display: none;
}

/* ---- Checkbox (Medical Disclaimer) ---- */
.checkbox-row {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
}

.custom-checkbox {
    width: 22px;
    height: 22px;
    border-radius: 6px;
    border: 2px solid var(--input-border);
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    margin-top: 2px;
}

.custom-checkbox.checked {
    background: var(--primary);
    border-color: var(--primary);
}

.custom-checkbox svg {
    width: 14px;
    height: 14px;
    stroke: #fff;
    stroke-width: 3;
    fill: none;
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.custom-checkbox.checked svg {
    opacity: 1;
    transform: scale(1);
}

.checkbox-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.5;
}

/* ---- Submit Button ---- */
.submit-btn {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary), #6248e0);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: 1rem;
    font-weight: 700;
    font-family: var(--font);
    cursor: pointer;
    transition: all 0.25s ease;
    letter-spacing: 0.5px;
    position: relative;
    overflow: hidden;
    margin-top: 20px;
}

.submit-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent, rgba(255, 255, 255, 0.1), transparent);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
}

.submit-btn:not(:disabled):hover::before {
    transform: translateX(100%);
}

.submit-btn:not(:disabled):active {
    transform: scale(0.97);
}

.submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.submit-btn .btn-loader {
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    vertical-align: middle;
}

/* ---- Toast notifications ---- */
.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--card);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    padding: 14px 20px;
    font-size: 0.88rem;
    color: var(--text);
    z-index: 10000;
    opacity: 0;
    transition: all 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    max-width: 90vw;
    text-align: center;
}

.toast.visible {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.toast.error {
    border-color: var(--error);
    background: rgba(239, 68, 68, 0.12);
}

.toast.success {
    border-color: var(--success);
    background: rgba(16, 185, 129, 0.12);
}

/* ---- Micro-animations ---- */
.fade-in {
    animation: fadeIn 0.5s ease forwards;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-section:nth-child(1) {
    animation-delay: 0.05s;
}

.form-section:nth-child(2) {
    animation-delay: 0.1s;
}

.form-section:nth-child(3) {
    animation-delay: 0.15s;
}

.form-section:nth-child(4) {
    animation-delay: 0.2s;
}

.form-section:nth-child(5) {
    animation-delay: 0.25s;
}

/* ---- Footer ---- */
.form-footer {
    text-align: center;
    padding: 24px 0 16px;
    color: var(--text-dim);
    font-size: 0.75rem;
    letter-spacing: 0.3px;
}

.form-footer a {
    color: var(--primary);
    text-decoration: none;
}

/* ---- Responsive (tablet+) ---- */
@media (min-width: 600px) {
    .app-container {
        padding-top: 20px;
    }

    .gym-header {
        padding-top: 48px;
    }
}