/**
 * SST Upload Portal — Mobile-First Student CSS
 *
 * Scoped under #sst-upload-portal to avoid collisions with
 * WordPress / Elementor theme styles on the upload page.
 */

/* ==========================================================================
   Base container
   ========================================================================== */

.sst-upload-portal {
    max-width: 480px;
    margin: 0 auto;
    padding: 16px 16px 40px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-size: 16px;
    line-height: 1.5;
    color: #1a1a1a;
    -webkit-font-smoothing: antialiased;
}

/* ==========================================================================
   Portal header (lock badge + lang toggle)
   ========================================================================== */

.sst-portal-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding-bottom: 20px;
    margin-bottom: 8px;
    border-bottom: 1px solid #f0f0f0;
    position: relative;
}

.sst-lang-toggle-wrap {
    position: absolute;
    top: 0;
    right: 0;
}

.sst-lang-toggle {
    background: transparent;
    border: 1px solid #ddd;
    border-radius: 4px;
    padding: 4px 10px;
    font-size: 13px;
    color: #555;
    cursor: pointer;
    line-height: 1.4;
    transition: border-color 0.15s, color 0.15s;
}

.sst-lang-toggle:hover {
    border-color: #F59E0B;
    color: #d97706;
}

.sst-portal-logo {
    margin: 0;
    line-height: 1;
}

.sst-portal-secure {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    color: #6b7280;
    margin: 0;
}

.sst-portal-secure svg {
    flex-shrink: 0;
    color: #10b981;
}

/* ==========================================================================
   Upload wizard shell
   ========================================================================== */

.sst-upload-wizard {
    min-height: 200px;
}

/* ==========================================================================
   Loading spinner (initial state before JS hydrates)
   ========================================================================== */

.sst-loading {
    display: flex;
    justify-content: center;
    padding: 48px 0;
}

.sst-loading-spinner {
    width: 36px;
    height: 36px;
    border: 3px solid #f0f0f0;
    border-top-color: #F59E0B;
    border-radius: 50%;
    animation: sst-spin 0.7s linear infinite;
}

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

/* ==========================================================================
   Personalized greeting
   ========================================================================== */

.sst-greeting {
    text-align: center;
    font-size: 15px;
    font-weight: 500;
    color: #374151;
    margin: 0 0 12px;
    line-height: 1.4;
}

/* ==========================================================================
   Step counter ("1 of 4")
   ========================================================================== */

.sst-step-counter {
    text-align: center;
    font-size: 12px;
    font-weight: 600;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    margin-bottom: 16px;
}

/* ==========================================================================
   Step heading + description
   ========================================================================== */

.sst-step-label {
    font-size: 20px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 6px;
    text-align: center;
}

.sst-step-desc {
    font-size: 14px;
    color: #6b7280;
    text-align: center;
    margin: 0 0 24px;
}

/* ==========================================================================
   Error message
   ========================================================================== */

.sst-error {
    background: #fef2f2;
    border: 1px solid #fca5a5;
    border-radius: 8px;
    color: #991b1b;
    padding: 12px 14px;
    font-size: 14px;
    margin-bottom: 16px;
}

/* ==========================================================================
   Image preview
   ========================================================================== */

.sst-preview {
    position: relative;
    margin-bottom: 16px;
    text-align: center;
}

.sst-preview img {
    max-height: 300px;
    max-width: 100%;
    border-radius: 8px;
    display: block;
    margin: 0 auto;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

.sst-preview-remove {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    border: none;
    cursor: pointer;
    font-size: 16px;
    line-height: 28px;
    text-align: center;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s;
}

.sst-preview-remove:hover {
    background: rgba(0, 0, 0, 0.75);
}

/* ==========================================================================
   Buttons
   ========================================================================== */

/* Shared */
.sst-btn-camera,
.sst-btn-file,
.sst-btn-confirm {
    display: block;
    width: 100%;
    border: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    text-align: center;
    transition: opacity 0.15s, transform 0.1s;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

.sst-btn-camera:active,
.sst-btn-file:active,
.sst-btn-confirm:active {
    transform: scale(0.98);
}

.sst-btn-camera:disabled,
.sst-btn-file:disabled,
.sst-btn-confirm:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* Camera / Take Photo — amber primary */
.sst-btn-camera {
    min-height: 56px;
    padding: 14px 20px;
    background: #F59E0B;
    color: #fff;
    margin-bottom: 10px;
}

.sst-btn-camera:hover:not(:disabled) {
    background: #d97706;
}

/* File picker — white secondary */
.sst-btn-file {
    min-height: 48px;
    padding: 11px 20px;
    background: #fff;
    color: #374151;
    border: 1px solid #ddd;
    margin-bottom: 10px;
}

.sst-btn-file:hover:not(:disabled) {
    border-color: #9ca3af;
    background: #f9fafb;
}

/* Confirm — green */
.sst-btn-confirm {
    min-height: 56px;
    padding: 14px 20px;
    background: #10b981;
    color: #fff;
    margin-bottom: 10px;
}

.sst-btn-confirm:hover:not(:disabled) {
    background: #059669;
}

/* Confirm: uploading state */
.sst-btn-confirm.is-uploading {
    opacity: 0.8;
    cursor: wait;
}

/* ==========================================================================
   Skip link
   ========================================================================== */

.sst-skip-wrap {
    text-align: center;
    margin-top: 4px;
}

.sst-skip {
    background: none;
    border: none;
    color: #9ca3af;
    font-size: 14px;
    text-decoration: underline;
    cursor: pointer;
    padding: 6px 0;
    line-height: 1.4;
}

.sst-skip:hover {
    color: #6b7280;
}

/* ==========================================================================
   Trust line (below buttons, above skip)
   ========================================================================== */

.sst-trust {
    font-size: 12px;
    color: #9ca3af;
    text-align: center;
    margin: 4px 0 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
}

.sst-trust svg {
    flex-shrink: 0;
    color: #10b981;
}

/* ==========================================================================
   Optional note section
   ========================================================================== */

.sst-note-section {
    border-top: 1px solid #f0f0f0;
    padding-top: 16px;
    margin-top: 16px;
}

.sst-note-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: #374151;
    margin-bottom: 6px;
}

.sst-note-textarea {
    width: 100%;
    box-sizing: border-box;
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 14px;
    font-family: inherit;
    color: #374151;
    resize: vertical;
    min-height: 70px;
    transition: border-color 0.15s;
}

.sst-note-textarea:focus {
    outline: none;
    border-color: #F59E0B;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

/* ==========================================================================
   All-done / success state
   ========================================================================== */

.sst-all-done {
    text-align: center;
    padding: 32px 16px 16px;
}

.sst-success-check {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #10b981;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
    animation: sst-scale-in 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

.sst-success-check svg {
    width: 32px;
    height: 32px;
    color: #fff;
    stroke: #fff;
    stroke-width: 3;
}

@keyframes sst-scale-in {
    from {
        opacity: 0;
        transform: scale(0.4);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.sst-all-done h2 {
    font-size: 22px;
    font-weight: 700;
    color: #111827;
    margin: 0 0 8px;
}

.sst-all-done p {
    font-size: 15px;
    color: #6b7280;
    margin: 0 0 24px;
}

.sst-back-to-course {
    display: inline-block;
    padding: 12px 28px;
    background: #F59E0B;
    color: #fff;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 700;
    font-size: 15px;
    transition: background 0.15s;
}

.sst-back-to-course:hover {
    background: #d97706;
    color: #fff;
    text-decoration: none;
}

/* ==========================================================================
   Received checkmark (per-step success flash)
   ========================================================================== */

.sst-received-flash {
    text-align: center;
    padding: 24px 0;
    animation: sst-scale-in 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

.sst-received-flash .sst-success-check {
    margin-bottom: 12px;
}

.sst-received-flash p {
    font-size: 18px;
    font-weight: 700;
    color: #059669;
    margin: 0;
}

/* ==========================================================================
   Phone number step
   ========================================================================== */

.sst-phone-field {
    margin: 20px 0 16px;
}

.sst-phone-input {
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
    display: block;
    padding: 14px 16px;
    font-size: 18px;
    font-weight: 500;
    border: 2px solid #d1d5db;
    border-radius: 10px;
    text-align: center;
    letter-spacing: 0.5px;
    background: #fff;
    color: #111;
    transition: border-color 0.2s;
    -webkit-appearance: none;
    appearance: none;
}

.sst-phone-input:focus {
    outline: none;
    border-color: #f59e0b;
    box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

.sst-phone-input::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

/* ==========================================================================
   Error page (no token / expired)
   ========================================================================== */

.sst-portal-error {
    text-align: center;
    padding: 32px 16px;
    border: 1px solid #fcd34d;
    border-radius: 10px;
    background: #fffbeb;
}

.sst-portal-error h2 {
    font-size: 20px;
    font-weight: 700;
    color: #92400e;
    margin: 0 0 8px;
}

.sst-portal-error p {
    font-size: 15px;
    color: #78350f;
    margin: 0;
    line-height: 1.6;
}

.sst-portal-error a {
    color: #b45309;
}

/* ==========================================================================
   Utility
   ========================================================================== */

.sst-hidden {
    display: none !important;
}

/* ==========================================================================
   Accessibility
   ========================================================================== */

.sst-btn-camera:focus-visible,
.sst-btn-file:focus-visible,
.sst-btn-confirm:focus-visible,
.sst-skip:focus-visible,
.sst-lang-toggle:focus-visible {
    outline: 2px solid #F59E0B;
    outline-offset: 2px;
}
