:root {
    --primary: #6366f1;
    --primary-glow: rgba(99, 102, 241, 0.4);
    --accent: #a855f7;
    --bg-dark: #0a0a0f;
    --bg-card: rgba(255, 255, 255, 0.04);
    --bg-card-hover: rgba(255, 255, 255, 0.08);
    --glass-bg: rgba(255, 255, 255, 0.06);
    --glass-border: rgba(255, 255, 255, 0.08);
    --text-primary: #f1f5f9;
    --text-secondary: #64748b;
    --text-muted: #475569;
    --success: #10b981;
    --success-glow: rgba(16, 185, 129, 0.3);
    --error: #ef4444;
    --border-radius: 20px;
}

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

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    background: var(--bg-dark);
    color: var(--text-primary);
    text-transform: uppercase;
    letter-spacing: 0.02em;
    -webkit-font-smoothing: antialiased;
}

/* ===================== */
/*    APP CONTAINER      */
/* ===================== */
.app-container {
    width: 100%;
    height: 100%;
    max-width: 480px;
    margin: 0 auto;
    position: relative;
    overflow: hidden;
}

/* ===================== */
/*    STEP SYSTEM        */
/* ===================== */
.step {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    padding: 24px 20px;
    overflow-y: auto;
    opacity: 0;
    transform: translateX(60px);
    pointer-events: none;
    transition: all 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.step.active {
    opacity: 1;
    transform: translateX(0);
    pointer-events: all;
}

.step.exit-left {
    opacity: 0;
    transform: translateX(-60px);
    pointer-events: none;
}

/* ===================== */
/*    STEP HEADER        */
/* ===================== */
.step-header {
    text-align: center;
    margin-bottom: 32px;
    flex-shrink: 0;
}

.step-badge {
    display: inline-block;
    padding: 6px 16px;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    border-radius: 100px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.15em;
    margin-bottom: 16px;
}

.step-header h1 {
    font-size: 32px;
    font-weight: 900;
    letter-spacing: -0.02em;
    background: linear-gradient(135deg, #fff 30%, var(--accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: 8px;
}

.step-header p {
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.1em;
}

/* ===================== */
/*    BACK BUTTON        */
/* ===================== */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.1em;
    cursor: pointer;
    padding: 8px 0;
    margin-bottom: 16px;
    text-transform: uppercase;
    transition: color 0.2s;
}

.back-btn:hover {
    color: var(--text-primary);
}

/* ===================== */
/*    CREW GRID          */
/* ===================== */
.crew-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    flex: 1;
    align-content: start;
}

.crew-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 32px 16px;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    cursor: pointer;
    font-family: inherit;
    color: var(--text-primary);
    text-transform: uppercase;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    -webkit-tap-highlight-color: transparent;
}

.crew-card:hover {
    background: var(--bg-card-hover);
    border-color: rgba(99, 102, 241, 0.3);
    transform: translateY(-4px);
    box-shadow: 0 20px 40px -10px rgba(99, 102, 241, 0.2);
}

.crew-card:active {
    transform: translateY(0) scale(0.97);
}

.crew-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary), var(--accent));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    font-weight: 900;
    letter-spacing: 0;
    box-shadow: 0 8px 24px var(--primary-glow);
}

.crew-card span {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.08em;
}

/* ===================== */
/*    CLUB LIST          */
/* ===================== */
.club-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    flex: 1;
}

.club-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 20px;
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    cursor: pointer;
    font-family: inherit;
    color: var(--text-primary);
    text-transform: uppercase;
    text-align: left;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    -webkit-tap-highlight-color: transparent;
}

.club-card:hover {
    background: var(--bg-card-hover);
    border-color: rgba(99, 102, 241, 0.3);
    transform: translateX(6px);
    box-shadow: 0 10px 30px -5px rgba(99, 102, 241, 0.15);
}

.club-card:active {
    transform: translateX(2px) scale(0.98);
}

.club-icon {
    width: 48px;
    height: 48px;
    border-radius: 14px;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    flex-shrink: 0;
}

.club-info {
    flex: 1;
}

.club-name {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.05em;
}

.arrow-icon {
    color: var(--text-muted);
    flex-shrink: 0;
    transition: transform 0.2s;
}

.club-card:hover .arrow-icon {
    transform: translateX(4px);
    color: var(--primary);
}

/* ===================== */
/*    EVENT FORM         */
/* ===================== */
.event-form {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Glass Panel */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    padding: 24px;
}

/* Selected Summary */
.selected-summary {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--glass-border);
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.summary-label {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-muted);
    letter-spacing: 0.12em;
}

.summary-value {
    font-size: 13px;
    font-weight: 700;
    color: var(--primary);
    letter-spacing: 0.05em;
}

/* Input Group */
.input-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.input-group label {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-secondary);
    letter-spacing: 0.12em;
    margin-left: 4px;
}

input[type="text"] {
    width: 100%;
    background: rgba(0, 0, 0, 0.3);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    padding: 18px;
    font-size: 16px;
    color: var(--text-primary);
    font-family: inherit;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.05em;
    transition: all 0.2s;
    outline: none;
}

input[type="text"]::placeholder {
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 500;
}

input[type="text"]:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-glow);
}

/* ===================== */
/*    NEXT BUTTON        */
/* ===================== */
.next-btn {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--accent) 100%);
    color: white;
    border: none;
    border-radius: 16px;
    font-size: 14px;
    font-weight: 800;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 10px 30px -5px var(--primary-glow);
    -webkit-tap-highlight-color: transparent;
    margin-top: auto;
}

.next-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px -5px var(--primary-glow);
}

.next-btn:active {
    transform: translateY(1px);
}

/* ===================== */
/*    CAMERA SECTION     */
/* ===================== */
.camera-section {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.photo-preview-area {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    background: rgba(0, 0, 0, 0.4);
    border: 2px dashed rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    flex-shrink: 0;
}

.photo-preview-area:hover {
    border-color: var(--primary);
    background: rgba(99, 102, 241, 0.05);
}

.photo-preview-area.has-photo {
    border-style: solid;
    border-color: var(--glass-border);
}

.photo-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    color: var(--text-muted);
    pointer-events: none;
}

.photo-placeholder span {
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.1em;
}

#photoInput {
    position: absolute;
    inset: 0;
    opacity: 0;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.image-preview {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 18px;
}

.retake-btn {
    position: absolute;
    bottom: 12px;
    right: 12px;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 100px;
    color: white;
    font-family: inherit;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    z-index: 10;
    transition: all 0.2s;
    -webkit-tap-highlight-color: transparent;
}

.retake-btn:hover {
    background: var(--error);
    border-color: var(--error);
}

/* Final Summary */
.final-summary {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* ===================== */
/*    SUBMIT BUTTON      */
/* ===================== */
.submit-btn {
    width: 100%;
    padding: 18px;
    background: linear-gradient(135deg, var(--success) 0%, #059669 100%);
    color: white;
    border: none;
    border-radius: 16px;
    font-size: 15px;
    font-weight: 800;
    font-family: inherit;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    box-shadow: 0 10px 30px -5px var(--success-glow);
    -webkit-tap-highlight-color: transparent;
    flex-shrink: 0;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 35px -5px var(--success-glow);
}

.submit-btn:active {
    transform: translateY(1px);
}

.submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* ===================== */
/*    LOADING SPINNER    */
/* ===================== */
.spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    border-top-color: white;
    animation: spin 0.8s linear infinite;
}

/* ===================== */
/*    SUCCESS MODAL      */
/* ===================== */
.modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(12px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    z-index: 1000;
    opacity: 1;
    transition: opacity 0.4s;
}

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

.modal-content {
    width: 100%;
    max-width: 400px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    transform: scale(1);
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

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

.modal-content h2 {
    font-size: 28px;
    font-weight: 900;
    letter-spacing: 0.02em;
}

.modal-content p {
    color: var(--text-secondary);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.05em;
    line-height: 1.6;
}

/* ===================== */
/*    SUCCESS CHECKMARK  */
/* ===================== */
.success-checkmark {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: rgba(16, 185, 129, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.check-icon {
    width: 40px;
    height: 40px;
    position: relative;
}

.icon-line {
    display: block;
    position: absolute;
    height: 4px;
    background: var(--success);
    border-radius: 4px;
}

.line-tip {
    width: 14px;
    top: 24px;
    left: 4px;
    transform: rotate(45deg);
    animation: tipIn 0.4s ease-out 0.2s both;
}

.line-long {
    width: 24px;
    top: 20px;
    left: 12px;
    transform: rotate(-45deg);
    animation: longIn 0.4s ease-out 0.4s both;
}

/* ===================== */
/*    UTILITIES          */
/* ===================== */
.hidden {
    display: none !important;
}

/* ===================== */
/*    ANIMATIONS         */
/* ===================== */
@keyframes spin {
    to { transform: rotate(360deg); }
}

@keyframes tipIn {
    from { width: 0; opacity: 0; }
    to { width: 14px; opacity: 1; }
}

@keyframes longIn {
    from { width: 0; opacity: 0; }
    to { width: 24px; opacity: 1; }
}

/* ===================== */
/*    SCROLLBAR          */
/* ===================== */
.step::-webkit-scrollbar {
    width: 0px;
}

/* Safe area for notched phones */
@supports (padding: env(safe-area-inset-top)) {
    .step {
        padding-top: calc(24px + env(safe-area-inset-top));
        padding-bottom: calc(24px + env(safe-area-inset-bottom));
    }
}

/* ===================== */
/*    OFFLINE BANNER     */
/* ===================== */
.offline-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 2000;
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    color: white;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    animation: slideDown 0.4s ease-out;
}

.offline-banner.hidden {
    display: none !important;
}

/* ===================== */
/*   PENDING INDICATOR   */
/* ===================== */
.pending-indicator {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 1500;
    background: rgba(245, 158, 11, 0.15);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(245, 158, 11, 0.3);
    color: #fbbf24;
    padding: 8px 14px;
    border-radius: 100px;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    animation: fadeInDown 0.4s ease-out;
    transition: all 0.2s;
}

.pending-indicator:hover {
    background: rgba(245, 158, 11, 0.25);
}

.pending-indicator.hidden {
    display: none !important;
}

.pending-indicator.sending {
    color: var(--primary);
    border-color: rgba(99, 102, 241, 0.3);
    background: rgba(99, 102, 241, 0.15);
}

.pending-pulse {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #fbbf24;
    animation: pulse 2s infinite;
}

.pending-indicator.sending .pending-pulse {
    background: var(--primary);
}

@keyframes pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(0.8); }
}

@keyframes slideDown {
    from { transform: translateY(-100%); }
    to { transform: translateY(0); }
}
