/* AdminDash css 07: Auth pages, activity list, loading states & scan-loader, order status badges, account info, settings layout, trial badge */

/* ============================================
   Auth Pages
   ============================================ */

.auth-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    position: relative;
    z-index: 1;
}

.auth-container {
    width: 100%;
    max-width: 420px;
}

.auth-card {
    background: var(--bg-elevated);
    border: 1px solid rgba(var(--overlay), 0.05);
    border-radius: 16px;
    padding: 40px;
    position: relative;
}

.auth-card::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 16px;
    padding: 1px;
    background: var(--gradient-primary);
    -webkit-mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    mask:
        linear-gradient(#fff 0 0) content-box,
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0.3;
    pointer-events: none;
}

.auth-header {
    text-align: center;
    margin-bottom: 32px;
}

.auth-header .logo {
    display: inline-flex;
    margin-bottom: 24px;
}

.auth-header h1 {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 8px;
}

.auth-header p {
    color: var(--gray-400);
    font-size: 0.9375rem;
}

.auth-form {
    position: relative;
    z-index: 1;
}

.auth-form .form-group {
    margin-bottom: 20px;
}

.auth-form .form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gray-300);
    margin-bottom: 8px;
}

.auth-form .form-input {
    width: 100%;
    background: rgba(var(--overlay), 0.05);
    border: 1px solid rgba(var(--overlay), 0.1);
    border-radius: 8px;
    padding: 14px 16px;
    font-size: 1rem;
    color: var(--white);
    transition: all 0.2s;
}

.auth-form .form-input:focus {
    outline: none;
    border-color: transparent;
    background:
        linear-gradient(var(--bg-card), var(--bg-card)) padding-box,
        linear-gradient(to right, #008fc1, #00f099, #008fc1, #00f099) border-box;
}

.auth-form .form-input::placeholder {
    color: var(--gray-500);
}

.auth-form .form-hint {
    display: block;
    font-size: 0.8125rem;
    color: var(--gray-500);
    margin-top: 6px;
}

.form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: var(--gray-400);
    font-size: 0.875rem;
}

.form-checkbox {
    width: 18px;
    height: 18px;
    accent-color: var(--green);
}

.form-link {
    color: var(--green);
    text-decoration: none;
    font-size: 0.875rem;
}

.form-link:hover {
    text-decoration: underline;
}

.auth-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid rgba(var(--overlay), 0.05);
}

.auth-footer p {
    color: var(--gray-400);
    font-size: 0.9375rem;
}

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

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

.auth-terms {
    text-align: center;
    margin-top: 20px;
    font-size: 0.8125rem;
    color: var(--gray-500);
    line-height: 1.6;
}

.auth-terms a {
    color: var(--gray-400);
    text-decoration: none;
}

.auth-terms a:hover {
    color: var(--green);
}

/* Alert Messages */
.alert {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-radius: 8px;
    margin-bottom: 20px;
    font-size: 0.9375rem;
}

.alert-error {
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.alert-success {
    background: rgba(19, 239, 149, 0.1);
    border: 1px solid rgba(19, 239, 149, 0.3);
    color: var(--green);
}

.alert-info {
    background: rgba(20, 154, 251, 0.1);
    border: 1px solid rgba(20, 154, 251, 0.3);
    color: #93c5fd;
}

.alert-icon {
    flex-shrink: 0;
}

.validation-message {
    color: #fca5a5;
    font-size: 0.8125rem;
    margin-top: 4px;
}

/* Loading State */
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

@media (max-width: 480px) {
    .auth-card {
        padding: 28px 20px;
    }
}

/* ============================================
   Activity List
   ============================================ */

.activity-list {
    display: flex;
    flex-direction: column;
}

.activity-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 0;
    border-bottom: 1px solid rgba(var(--overlay), 0.05);
}

.activity-item:last-child {
    border-bottom: none;
}

.activity-icon {
    font-size: 1.25rem;
    flex-shrink: 0;
}

.activity-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.activity-description {
    color: var(--gray-300);
    font-size: 0.9375rem;
}

.activity-time {
    color: var(--gray-500);
    font-size: 0.8125rem;
}

/* ============================================
   Loading States
   ============================================ */

.loading-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 80px 40px;
    color: var(--gray-400);
}

/* Scan-loader: logo with scanning line animation */
.scan-loader {
    position: relative;
    display: inline-block;
    padding: 20px 30px;
    margin-bottom: 16px;
}

.scan-logo {
    position: relative;
    z-index: 2;
    height: 36px;
    animation: scanLogoReact 3.5s ease-in-out infinite;
}

.scan-line {
    position: absolute;
    top: -10%;
    bottom: -10%;
    width: 2px;
    z-index: 3;
    background: linear-gradient(180deg, transparent 0%, rgba(19, 239, 149, 0.4) 15%, #13EF95 50%, rgba(19, 239, 149, 0.4) 85%, transparent 100%);
    box-shadow: 0 0 8px rgba(19, 239, 149, 0.6), 0 0 20px rgba(19, 239, 149, 0.3), 0 0 40px rgba(19, 239, 149, 0.15);
    border-radius: 2px;
    animation: scanLineMove 3.5s ease-in-out infinite;
}

.scan-line::after {
    content: '';
    position: absolute;
    top: 10%;
    bottom: 10%;
    left: 0;
    width: 20px;
    background: linear-gradient(90deg, rgba(19, 239, 149, 0.12), transparent);
}

@keyframes scanLogoReact {
    0%, 100% { filter: brightness(0.75) drop-shadow(0 0 0 transparent); }
    25% { filter: brightness(1.15) drop-shadow(0 0 12px rgba(19, 239, 149, 0.45)); }
    50% { filter: brightness(0.75) drop-shadow(0 0 0 transparent); }
    75% { filter: brightness(1.15) drop-shadow(0 0 12px rgba(19, 239, 149, 0.45)); }
}

@keyframes scanLineMove {
    0% { left: 0; opacity: 0; }
    5% { opacity: 1; }
    48% { left: calc(100% - 2px); opacity: 1; }
    50% { left: calc(100% - 2px); opacity: 0; }
    55% { opacity: 1; }
    98% { left: 0; opacity: 1; }
    100% { left: 0; opacity: 0; }
}

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

/* Action buttons as links */
a.action-btn {
    text-decoration: none;
}

/* ============================================
   Order Status Badges
   ============================================ */

.status-badge.status-pending {
    background: rgba(20, 154, 251, 0.1);
    color: var(--cyan);
}

.status-badge.status-synced {
    background: rgba(19, 239, 149, 0.1);
    color: var(--green);
}

.status-badge.status-fflhold {
    background: rgba(250, 204, 21, 0.1);
    color: #fcd34d;
}

.status-badge.status-shipped {
    background: rgba(168, 85, 247, 0.1);
    color: #c084fc;
}

.status-badge.status-cancelled {
    background: rgba(239, 68, 68, 0.1);
    color: #f87171;
}

/* Order table extras */
.order-secondary {
    font-size: 0.8125rem;
    color: var(--gray-500);
}

.action-buttons {
    display: flex;
    gap: 8px;
}

.btn-action {
    background: rgba(var(--overlay), 0.05);
    border: 1px solid rgba(var(--overlay), 0.1);
    border-radius: 4px;
    padding: 6px 10px;
    font-size: 0.75rem;
    color: var(--gray-300);
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.btn-action:hover {
    border-color: transparent;
    background:
        linear-gradient(var(--bg-card), var(--bg-card)) padding-box,
        linear-gradient(to right, #008fc1, #00f099, #008fc1, #00f099) border-box;
    color: var(--cyan);
}

/* Data table row hover */
.data-table tbody tr:not(.empty-row):hover {
    background: rgba(var(--overlay), 0.02);
}

/* ============================================
   Account Info
   ============================================ */

.account-info {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.account-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid rgba(var(--overlay), 0.05);
}

.account-row:last-child {
    border-bottom: none;
}

.account-label {
    color: var(--gray-500);
    font-size: 0.875rem;
}

.account-value {
    color: var(--white);
    font-weight: 500;
}

.account-value.trial-active {
    color: var(--green);
}

.account-value.trial-expired {
    color: #f87171;
}

/* Settings Page Layout */
.settings-page {
    max-width: 900px;
    margin: 0 auto;
    padding: 0 24px;
}

.settings-page .settings-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
    margin-bottom: 24px;
}

.settings-page .dashboard-card {
    height: fit-content;
}

.settings-page .dashboard-card .card-body {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.settings-page .form-group {
    margin: 0;
}

.settings-actions {
    display: flex;
    gap: 12px;
    padding: 24px 0;
    border-top: 1px solid rgba(var(--overlay), 0.05);
}

.plan-badge {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.plan-badge.free {
    background: rgba(var(--overlay), 0.1);
    color: var(--gray-400);
}

.plan-badge.retail {
    background: rgba(19, 239, 149, 0.15);
    color: var(--green);
}

.plan-badge.enterprise {
    background: rgba(168, 85, 247, 0.15);
    color: #a855f7;
}

.loading-spinner-sm {
    width: 16px;
    height: 16px;
    border: 2px solid rgba(var(--overlay), 0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.alert-dismiss {
    background: none;
    border: none;
    color: inherit;
    font-size: 1.25rem;
    cursor: pointer;
    padding: 0 4px;
    margin-left: auto;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.alert-dismiss:hover {
    opacity: 1;
}

.alert {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
}

@media (max-width: 768px) {
    .settings-page {
        padding: 0 16px;
    }

    .settings-page .settings-grid {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .account-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .settings-row {
        padding: 12px 0;
    }

    .settings-actions {
        flex-direction: column;
    }

    .settings-actions .btn {
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 480px) {
    .settings-page {
        padding: 0 8px;
    }

    .settings-page .settings-grid {
        gap: 12px;
    }

    .account-row .account-label {
        font-size: 0.8rem;
    }

    .account-row .account-value {
        font-size: 0.875rem;
    }

    .settings-row {
        padding: 10px 0;
    }

    .setting-name {
        font-size: 0.9rem;
    }

    .setting-desc {
        font-size: 0.75rem;
    }

    .settings-actions {
        padding: 16px 0;
        gap: 8px;
    }
}

/* ============================================
   Trial Badge
   ============================================ */

.trial-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(250, 204, 21, 0.1);
    border: 1px solid rgba(250, 204, 21, 0.3);
    border-radius: 100px;
    padding: 6px 12px;
    font-size: 0.8125rem;
}

.trial-icon {
    font-size: 0.875rem;
}

.trial-text {
    color: #fcd34d;
    font-weight: 500;
}
