/*
 * AXON Club Portal — CSS
 * v2.0.0
 *
 * Color tokens:
 *   --axon-sand:    #f2e2c6 (Sandstone/Beige)
 *   --axon-emerald: #29653c (Emerald Green)
 *   --axon-emerald-dark: #1d683d
 *
 * Typography: Almarai (inherited from theme or loaded conditionally)
 * All color references go through CSS custom properties.
 * No hardcoded inline values are permitted in this stylesheet.
 */

/* =========================================================================
   CSS Custom Properties
   ========================================================================= */
:root {
    --axon-sand:           #f2e2c6;
    --axon-sand-light:     #faf4eb;
    --axon-sand-dark:      #e0c9a4;
    --axon-emerald:        #29653c;
    --axon-emerald-dark:   #1d683d;
    --axon-emerald-light:  rgba(41, 101, 60, 0.08);
    --axon-emerald-glow:   rgba(41, 101, 60, 0.25);
    --axon-text:           #1a1a1a;
    --axon-text-muted:     #6b6b6b;
    --axon-text-light:     #999;
    --axon-border:         rgba(0, 0, 0, 0.08);
    --axon-border-focus:   var(--axon-emerald);
    --axon-surface:        rgba(255, 255, 255, 0.72);
    --axon-radius-sm:      8px;
    --axon-radius:         14px;
    --axon-radius-lg:      20px;
    --axon-radius-xl:      28px;
    --axon-shadow-sm:      0 2px 8px rgba(0, 0, 0, 0.06);
    --axon-shadow:         0 8px 32px rgba(0, 0, 0, 0.08);
    --axon-shadow-lg:      0 16px 48px rgba(0, 0, 0, 0.12);
    --axon-font:           'Almarai', sans-serif;
    --axon-transition:     0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* =========================================================================
   Base Wrapper
   ========================================================================= */
.axon-portal-wrapper {
    font-family: var(--axon-font);
    color: var(--axon-text);
    direction: rtl;
    text-align: right;
    min-height: 60vh;
    padding: 40px 16px 80px;
    box-sizing: border-box;
}

.axon-portal-wrapper *,
.axon-portal-wrapper *::before,
.axon-portal-wrapper *::after {
    box-sizing: border-box;
}

.axon-portal-container {
    max-width: 640px;
    margin: 0 auto;
}

.axon-portal-container--wide {
    max-width: 920px;
}

/* =========================================================================
   Toast Notification
   ========================================================================= */
.axon-club-toast {
    padding: 14px 18px;
    border-radius: var(--axon-radius);
    font-weight: 700;
    font-size: 14px;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.axon-club-toast.hidden {
    display: none !important;
}

.axon-club-toast--error {
    background: rgba(220, 53, 69, 0.12);
    border: 1px solid rgba(220, 53, 69, 0.3);
    color: #c0392b;
}

.axon-club-toast--success {
    background: var(--axon-emerald-light);
    border: 1px solid var(--axon-emerald-glow);
    color: var(--axon-emerald);
}

.axon-club-toast--info {
    background: var(--axon-sand-light);
    border: 1px solid var(--axon-sand-dark);
    color: #7a5c2e;
}

/* =========================================================================
   Alert Box (token expired, etc.)
   ========================================================================= */
.axon-alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border-radius: var(--axon-radius);
    margin-bottom: 24px;
    font-size: 14px;
    font-weight: 600;
}

.axon-alert-warning {
    background: #fff8e6;
    border: 1px solid #f0c040;
    color: #7a5c2e;
}

/* =========================================================================
   Portal Header (State A)
   ========================================================================= */
.axon-portal-header {
    text-align: right;
    margin-bottom: 36px;
}

.axon-badge-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--axon-emerald-light);
    border: 1px solid var(--axon-emerald-glow);
    color: var(--axon-emerald);
    padding: 6px 14px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 16px;
    letter-spacing: 0.02em;
}

.axon-portal-title {
    font-size: clamp(22px, 5vw, 32px);
    font-weight: 800;
    color: var(--axon-text);
    margin: 0 0 12px;
    line-height: 1.3;
}

.axon-brand {
    color: var(--axon-emerald);
}

.axon-portal-subtitle {
    color: var(--axon-text-muted);
    font-size: 15px;
    margin: 0;
    line-height: 1.7;
}

/* =========================================================================
   Form Elements
   ========================================================================= */
.axon-club-form {
    background: var(--axon-surface);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--axon-border);
    border-radius: var(--axon-radius-xl);
    padding: 32px;
    box-shadow: var(--axon-shadow);
}

.axon-form-section-label {
    font-size: 11px;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--axon-text-light);
    margin-bottom: 20px;
}

.axon-field-row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 16px;
}

@media (min-width: 520px) {
    .axon-field-row:has(.axon-field + .axon-field) {
        grid-template-columns: 1fr 1fr;
    }
}

.axon-field {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.axon-field label {
    font-size: 13px;
    font-weight: 700;
    color: #444;
}

.axon-field input[type="text"],
.axon-field input[type="tel"],
.axon-field input[type="number"],
.axon-field select,
.axon-field textarea {
    width: 100%;
    padding: 13px 16px;
    border: 1.5px solid var(--axon-border);
    border-radius: var(--axon-radius);
    font-family: var(--axon-font);
    font-size: 15px;
    color: var(--axon-text);
    background: rgba(255, 255, 255, 0.85);
    transition: border-color var(--axon-transition), box-shadow var(--axon-transition);
    appearance: none;
    -webkit-appearance: none;
}

.axon-field input:focus,
.axon-field select:focus,
.axon-field textarea:focus {
    outline: none;
    border-color: var(--axon-emerald);
    box-shadow: 0 0 0 3px var(--axon-emerald-light);
}

.axon-field-hint {
    font-size: 12px;
    color: var(--axon-text-muted);
    margin: 4px 0 0;
}

/* Phone field */
.axon-phone-field {
    display: flex;
    align-items: stretch;
}

.axon-phone-prefix {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 0 12px;
    background: var(--axon-sand);
    border: 1.5px solid var(--axon-border);
    border-left: none;
    border-radius: var(--axon-radius) 0 0 var(--axon-radius);
    font-size: 13px;
    font-weight: 700;
    color: #5a3e2b;
    white-space: nowrap;
    flex-shrink: 0;
}

.axon-phone-field input {
    border-radius: 0 var(--axon-radius) var(--axon-radius) 0;
    border-right: none;
    direction: ltr;
    text-align: left;
}

/* Checkbox grid */
.axon-checkbox-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.axon-check-item {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    color: var(--axon-text);
    padding: 8px 14px;
    border: 1.5px solid var(--axon-border);
    border-radius: var(--axon-radius-sm);
    transition: all var(--axon-transition);
    user-select: none;
}

.axon-check-item input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.axon-check-box {
    width: 18px;
    height: 18px;
    border: 2px solid var(--axon-border);
    border-radius: 5px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all var(--axon-transition);
    background: white;
}

.axon-check-item input:checked ~ .axon-check-box {
    background: var(--axon-emerald);
    border-color: var(--axon-emerald);
}

.axon-check-item input:checked ~ .axon-check-box::after {
    content: '';
    display: block;
    width: 5px;
    height: 9px;
    border: 2px solid white;
    border-top: none;
    border-left: none;
    transform: rotate(45deg) translateY(-1px);
}

.axon-check-item:has(input:checked) {
    border-color: var(--axon-emerald);
    background: var(--axon-emerald-light);
    color: var(--axon-emerald);
}

/* =========================================================================
   Buttons
   ========================================================================= */
.axon-btn-primary {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 15px 24px;
    background: var(--axon-emerald);
    color: white;
    border: none;
    border-radius: var(--axon-radius);
    font-family: var(--axon-font);
    font-size: 16px;
    font-weight: 800;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: background var(--axon-transition), transform var(--axon-transition), box-shadow var(--axon-transition);
    margin-top: 8px;
}

.axon-btn-primary:hover {
    background: var(--axon-emerald-dark);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px var(--axon-emerald-glow);
}

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

.axon-btn-primary.loading .axon-btn-text {
    opacity: 0;
}

.axon-btn-submit {
    width: auto;
    min-width: 220px;
}

.axon-btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: 1.5px solid var(--axon-border);
    color: var(--axon-text-muted);
    padding: 10px 18px;
    border-radius: var(--axon-radius-sm);
    font-family: var(--axon-font);
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    text-decoration: none;
    transition: all var(--axon-transition);
}

.axon-btn-ghost:hover {
    border-color: var(--axon-emerald);
    color: var(--axon-emerald);
    background: var(--axon-emerald-light);
}

/* Button Loader */
.axon-btn-loader {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 22px;
    height: 22px;
    border: 3px solid rgba(255, 255, 255, 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: axon-portal-spin 0.8s linear infinite;
}

.axon-btn-loader.hidden {
    display: none !important;
}

@keyframes axon-portal-spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* =========================================================================
   Form Toggle Links (State A)
   ========================================================================= */

/* Plugin-owned hide utility — not subject to theme .hidden overrides */
.axon-hidden {
    display: none !important;
}

.axon-form-switch-link {
    text-align: center;
    margin-top: 24px;
    font-size: 14px;
    color: var(--axon-text-muted);
}

.axon-form-switch-link a {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--axon-emerald);
    font-weight: 700;
    font-family: var(--axon-font);
    font-size: 14px;
    text-decoration: none;
    background: var(--axon-emerald-light);
    border: 1.5px solid var(--axon-emerald-glow);
    border-radius: 100px;
    padding: 7px 18px;
    margin-right: 6px;
    transition: background var(--axon-transition), border-color var(--axon-transition), box-shadow var(--axon-transition);
}

.axon-form-switch-link a:hover {
    background: rgba(41, 101, 60, 0.14);
    border-color: var(--axon-emerald);
    box-shadow: 0 2px 10px var(--axon-emerald-glow);
}

#axon-login-container {
    margin-top: 16px;
}

.axon-login-panel-inner {
    padding: 24px;
    background: var(--axon-surface);
    border: 1px solid var(--axon-border);
    border-radius: var(--axon-radius-lg);
}

.axon-login-panel-inner h3 {
    font-size: 16px;
    font-weight: 700;
    margin: 0 0 20px;
    color: var(--axon-text);
}

.axon-login-form {
    background: transparent;
    box-shadow: none;
    border: none;
    padding: 0;
    backdrop-filter: none;
}

/* =========================================================================
   Status Card (State B)
   ========================================================================= */
.axon-status-card {
    background: var(--axon-sand-light);
    border: 1px solid var(--axon-sand-dark);
    border-radius: var(--axon-radius-xl);
    padding: 40px 32px;
    text-align: center;
    margin-bottom: 32px;
    position: relative;
    overflow: hidden;
}

.axon-status-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--axon-emerald), #5aad70);
}

.axon-status-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    background: white;
    border: 2px solid var(--axon-sand-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
    box-shadow: var(--axon-shadow-sm);
}

.axon-status-badge {
    display: inline-block;
    padding: 5px 16px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 0.05em;
    margin-bottom: 16px;
}

.axon-badge-pending {
    background: rgba(41, 101, 60, 0.1);
    color: var(--axon-emerald);
    border: 1px solid var(--axon-emerald-glow);
}

.axon-status-title {
    font-size: clamp(20px, 4vw, 26px);
    font-weight: 800;
    color: var(--axon-text);
    margin: 0 0 12px;
}

.axon-status-message {
    color: var(--axon-text-muted);
    font-size: 15px;
    line-height: 1.8;
    margin: 0 0 20px;
}

.axon-status-meta {
    margin-bottom: 28px;
}

.axon-meta-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: white;
    border: 1px solid var(--axon-sand-dark);
    color: var(--axon-text-muted);
    padding: 5px 14px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 700;
}

/* Progress Steps */
.axon-progress-steps {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-top: 24px;
}

.axon-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    font-weight: 700;
    color: var(--axon-text-muted);
}

.axon-step-dot {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.axon-step-done .axon-step-dot {
    background: var(--axon-emerald);
}

.axon-step-done {
    color: var(--axon-emerald);
}

.axon-step-active .axon-step-dot {
    background: var(--axon-emerald);
    box-shadow: 0 0 0 4px var(--axon-emerald-light);
}

.axon-step-active {
    color: var(--axon-emerald);
}

.axon-step-line {
    flex: 1;
    height: 2px;
    background: #e0e0e0;
    min-width: 40px;
    max-width: 80px;
    margin-bottom: 20px;
}

@keyframes axon-pulse {
    0%, 100% { box-shadow: 0 0 0 4px var(--axon-emerald-light); }
    50%       { box-shadow: 0 0 0 8px rgba(41, 101, 60, 0.12); }
}

.axon-pulse {
    animation: axon-pulse 2s ease-in-out infinite;
}

/* =========================================================================
   Locked Catalog (State B)
   ========================================================================= */
.axon-locked-catalog {
    border: 1px solid var(--axon-sand-dark);
    border-radius: var(--axon-radius-xl);
    overflow: hidden;
}

.axon-locked-catalog-header {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 20px;
    background: var(--axon-sand);
    font-size: 13px;
    font-weight: 700;
    color: var(--axon-emerald);
    border-bottom: 1px solid var(--axon-sand-dark);
}

.axon-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 12px;
    padding: 20px;
}

.axon-product-card {
    border-radius: var(--axon-radius);
    overflow: hidden;
    background: white;
    border: 1px solid var(--axon-border);
}

.axon-product-card-blurred .axon-product-name,
.axon-product-card-blurred .axon-product-sku {
    filter: blur(5px);
    user-select: none;
    pointer-events: none;
}

.axon-product-img-placeholder {
    height: 100px;
    background: var(--axon-sand-light);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.axon-products-locked .axon-product-img-placeholder::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(242, 226, 198, 0.6);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
}

.axon-product-lock-icon {
    position: relative;
    z-index: 1;
}

.axon-product-info {
    padding: 10px 12px;
}

.axon-product-name {
    font-size: 12px;
    font-weight: 700;
    color: var(--axon-text);
    margin-bottom: 4px;
}

.axon-product-sku {
    font-size: 10px;
    color: var(--axon-text-light);
    direction: ltr;
    text-align: left;
    margin-bottom: 6px;
}

.axon-category-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    background: var(--axon-sand);
    color: #7a5c2e;
    padding: 2px 8px;
    border-radius: 100px;
}

.axon-unlock-notice {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 14px 20px;
    background: var(--axon-emerald-light);
    border-top: 1px solid var(--axon-emerald-glow);
    font-size: 13px;
    font-weight: 600;
    color: var(--axon-emerald);
}

/* =========================================================================
   Footer Actions (logout, etc.)
   ========================================================================= */
.axon-portal-footer-actions {
    display: flex;
    justify-content: center;
    margin-top: 24px;
}

/* =========================================================================
   Approved State (State C)
   ========================================================================= */
.axon-approved-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.axon-badge-approved {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--axon-emerald);
    color: white;
    padding: 5px 14px;
    border-radius: 100px;
    font-size: 12px;
    font-weight: 800;
    margin-bottom: 12px;
}

.axon-approved-title {
    font-size: clamp(20px, 4vw, 28px);
    font-weight: 800;
    color: var(--axon-text);
    margin: 0 0 8px;
}

.axon-approved-subtitle {
    color: var(--axon-text-muted);
    font-size: 14px;
    margin: 0;
    line-height: 1.7;
}

/* Product Section */
.axon-product-section {
    margin-bottom: 36px;
}

.axon-section-title {
    font-size: 16px;
    font-weight: 800;
    color: var(--axon-text);
    margin: 0 0 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--axon-sand);
}

/* Pre-order Grid */
.axon-preorder-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 12px;
}

.axon-preorder-card {
    display: grid;
    grid-template-columns: 64px 1fr auto;
    align-items: center;
    gap: 12px;
    padding: 14px;
    background: white;
    border: 1.5px solid var(--axon-border);
    border-radius: var(--axon-radius);
    transition: border-color var(--axon-transition), box-shadow var(--axon-transition);
}

.axon-preorder-card:hover {
    border-color: var(--axon-emerald-glow);
    box-shadow: var(--axon-shadow-sm);
}

.axon-preorder-product-img {
    width: 64px;
    height: 64px;
    border-radius: var(--axon-radius-sm);
    background: var(--axon-sand-light);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    flex-shrink: 0;
}

.axon-approved-badge-mini {
    position: absolute;
    top: -4px;
    left: -4px;
    width: 18px;
    height: 18px;
    background: var(--axon-emerald);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.axon-preorder-product-name {
    font-size: 13px;
    font-weight: 700;
    color: var(--axon-text);
    margin-bottom: 3px;
}

.axon-preorder-product-sku {
    font-size: 10px;
    color: var(--axon-text-light);
    direction: ltr;
    text-align: left;
}

/* Quantity Control */
.axon-qty-control {
    display: flex;
    align-items: center;
    gap: 0;
    border: 1.5px solid var(--axon-border);
    border-radius: var(--axon-radius-sm);
    overflow: hidden;
    flex-shrink: 0;
}

.axon-qty-btn {
    width: 32px;
    height: 36px;
    background: var(--axon-sand-light);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--axon-text-muted);
    transition: background var(--axon-transition), color var(--axon-transition);
    flex-shrink: 0;
}

.axon-qty-btn:hover {
    background: var(--axon-emerald-light);
    color: var(--axon-emerald);
}

.axon-qty-input {
    width: 52px;
    height: 36px;
    border: none;
    border-right: 1px solid var(--axon-border);
    border-left: 1px solid var(--axon-border);
    text-align: center;
    font-family: var(--axon-font);
    font-size: 14px;
    font-weight: 700;
    color: var(--axon-text);
    background: white;
    -moz-appearance: textfield;
    appearance: textfield;
    padding: 0;
}

.axon-qty-input::-webkit-inner-spin-button,
.axon-qty-input::-webkit-outer-spin-button {
    -webkit-appearance: none;
}

.axon-qty-input:focus {
    outline: none;
    background: var(--axon-emerald-light);
}

/* Pre-order Notes */
.axon-preorder-notes {
    margin-bottom: 24px;
}

.axon-preorder-notes label {
    display: block;
    font-size: 13px;
    font-weight: 700;
    color: #444;
    margin-bottom: 8px;
}

.axon-preorder-notes textarea {
    width: 100%;
    padding: 13px 16px;
    border: 1.5px solid var(--axon-border);
    border-radius: var(--axon-radius);
    font-family: var(--axon-font);
    font-size: 14px;
    color: var(--axon-text);
    background: white;
    resize: vertical;
    transition: border-color var(--axon-transition);
}

.axon-preorder-notes textarea:focus {
    outline: none;
    border-color: var(--axon-emerald);
    box-shadow: 0 0 0 3px var(--axon-emerald-light);
}

/* Summary Bar */
.axon-preorder-summary-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    padding: 20px 24px;
    background: var(--axon-sand-light);
    border: 1px solid var(--axon-sand-dark);
    border-radius: var(--axon-radius-lg);
    position: sticky;
    bottom: 16px;
    z-index: 10;
    box-shadow: var(--axon-shadow);
}

.axon-summary-total {
    font-size: 15px;
    font-weight: 700;
    color: var(--axon-text);
}

.axon-summary-total strong {
    color: var(--axon-emerald);
    font-size: 18px;
}

.axon-summary-status {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 12px;
    font-weight: 700;
    color: var(--axon-emerald);
}

/* =========================================================================
   Responsive Adjustments
   ========================================================================= */
@media (max-width: 480px) {
    .axon-portal-wrapper {
        padding: 24px 12px 60px;
    }

    .axon-club-form {
        padding: 24px 18px;
    }

    .axon-status-card {
        padding: 28px 20px;
    }

    .axon-preorder-grid {
        grid-template-columns: 1fr;
    }

    .axon-preorder-summary-bar {
        flex-direction: column;
        align-items: stretch;
        text-align: center;
    }

    .axon-btn-submit {
        width: 100%;
    }

    .axon-approved-header {
        flex-direction: column;
    }

    .axon-step-line {
        min-width: 24px;
    }
}
