/* Admin panel login — Sepal Yar landing design system */

.ap-auth-page {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow-x: hidden;
}

.ap-auth-page::before {
    content: '';
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse 75% 45% at 90% 0%, rgba(59, 182, 93, 0.09), transparent 50%),
        radial-gradient(ellipse 55% 40% at 5% 100%, rgba(10, 21, 48, 0.06), transparent 45%);
    pointer-events: none;
    z-index: 0;
}

.ap-auth-orb {
    position: fixed;
    border-radius: 50%;
    filter: blur(70px);
    pointer-events: none;
    z-index: 0;
}

.ap-auth-orb-1 {
    width: 300px;
    height: 300px;
    top: -90px;
    right: -70px;
    background: rgba(59, 182, 93, 0.22);
    animation: ap-orb-1 16s ease-in-out infinite;
}

.ap-auth-orb-2 {
    width: 280px;
    height: 280px;
    bottom: -70px;
    left: -50px;
    background: rgba(10, 21, 48, 0.12);
    animation: ap-orb-2 20s ease-in-out infinite;
}

@keyframes ap-orb-1 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-20px, 18px); }
}

@keyframes ap-orb-2 {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(18px, -14px); }
}

.ap-auth-header {
    position: relative;
    z-index: 2;
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 20px clamp(1rem, 3vw, 1.5rem);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.ap-auth-header .logo-wrap img {
    height: 40px;
    width: auto;
}

.ap-auth-header .back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(8px);
    transition: color 0.2s, border-color 0.2s, box-shadow 0.2s;
}

.ap-auth-header .back-link:hover {
    color: var(--navy);
    border-color: rgba(10, 21, 48, 0.15);
    box-shadow: var(--shadow-xs);
}

.ap-auth-main {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px clamp(1rem, 3vw, 1.5rem) 48px;
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    gap: clamp(32px, 5vw, 64px);
}

.ap-auth-showcase {
    flex: 1;
    max-width: 480px;
    display: none;
}

@media (min-width: 900px) {
    .ap-auth-showcase {
        display: block;
    }
}

.ap-auth-showcase .showcase-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 999px;
    background: rgba(10, 21, 48, 0.06);
    color: var(--navy);
    font-weight: 700;
    font-size: 0.8125rem;
    margin-bottom: 20px;
    border: 1px solid rgba(10, 21, 48, 0.1);
}

.ap-auth-showcase .showcase-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary);
    animation: pulse-dot 2s ease infinite;
}

.ap-auth-showcase h1 {
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    font-weight: 800;
    color: var(--navy);
    line-height: 1.3;
    margin-bottom: 14px;
    letter-spacing: -0.02em;
}

.ap-auth-showcase .showcase-lead {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.85;
    margin-bottom: 28px;
}

.ap-auth-features {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.ap-auth-features li {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-xs);
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.ap-auth-features li i {
    color: var(--navy);
    font-size: 1.15rem;
    margin-top: 2px;
    flex-shrink: 0;
}

.ap-auth-features li strong {
    display: block;
    color: var(--navy);
    font-weight: 700;
    margin-bottom: 2px;
}

.ap-auth-card-wrap {
    width: 100%;
    max-width: 440px;
    flex-shrink: 0;
}

.ap-auth-card {
    background: var(--bg-elevated);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 36px 32px 32px;
    box-shadow: var(--shadow-lg);
    position: relative;
    overflow: hidden;
}

.ap-auth-card::before {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    left: 0;
    height: 4px;
    background: linear-gradient(90deg, var(--navy), var(--primary));
}

.ap-card-logo-mobile {
    display: none;
    text-align: center;
    margin-bottom: 24px;
}

.ap-card-logo-mobile img {
    height: 44px;
    width: auto;
}

@media (max-width: 899px) {
    .ap-card-logo-mobile {
        display: block;
    }
}

.ap-auth-card .card-title {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--navy);
    text-align: center;
    margin-bottom: 6px;
}

.ap-auth-card .card-subtitle {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 24px;
    line-height: 1.6;
}

/* Step indicator (OTP flow) */
.ap-step-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    margin-bottom: 28px;
}

.ap-step-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    min-width: 72px;
}

.ap-step-number {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    font-weight: 800;
    background: var(--bg-page);
    color: var(--text-muted);
    border: 2px solid var(--border);
    transition: all 0.25s;
}

.ap-step-item.completed .ap-step-number {
    background: var(--primary-soft);
    color: var(--primary-dark);
    border-color: var(--primary);
}

.ap-step-item.active .ap-step-number {
    background: var(--navy);
    color: #fff;
    border-color: var(--navy);
    box-shadow: 0 4px 12px rgba(10, 21, 48, 0.25);
}

.ap-step-label {
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--text-muted);
}

.ap-step-item.active .ap-step-label {
    color: var(--navy);
}

.ap-step-connector {
    width: 48px;
    height: 2px;
    background: var(--border);
    margin-bottom: 22px;
}

.ap-auth-messages {
    margin-bottom: 20px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.ap-auth-alert {
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.5;
}

.ap-auth-alert.error,
.ap-auth-alert.danger {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.ap-auth-alert.success {
    background: var(--primary-soft);
    color: var(--primary-dark);
    border: 1px solid rgba(59, 182, 93, 0.25);
}

.ap-auth-alert.warning {
    background: #fffbeb;
    color: #b45309;
    border: 1px solid #fde68a;
}

.ap-auth-alert.info {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.ap-field {
    margin-bottom: 18px;
}

.ap-field label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 700;
    color: var(--navy-muted);
    margin-bottom: 8px;
}

.ap-field-inner {
    position: relative;
}

.ap-field-inner .field-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    font-size: 1.1rem;
    pointer-events: none;
    transition: color 0.2s;
}

.ap-field-inner input {
    width: 100%;
    padding: 14px 44px 14px 16px;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    font-size: 1rem;
    font-family: inherit;
    color: var(--text);
    background: #fafbfc;
    transition: border-color 0.2s, box-shadow 0.2s, background 0.2s;
    outline: none;
}

.ap-field-inner input::placeholder {
    color: var(--text-muted);
}

.ap-field-inner input:hover {
    border-color: #c5cdd9;
}

.ap-field-inner input:focus {
    border-color: var(--navy);
    background: #fff;
    box-shadow: 0 0 0 4px rgba(10, 21, 48, 0.08);
}

.ap-field-inner:focus-within .field-icon {
    color: var(--navy);
}

.ap-field-inner .toggle-pw {
    position: absolute;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 4px;
    font-size: 1.1rem;
}

.ap-field-inner .toggle-pw:hover {
    color: var(--navy);
}

/* OTP input */
.ap-otp-input {
    text-align: center;
    font-size: 1.5rem !important;
    font-weight: 800;
    letter-spacing: 0.35em;
    font-family: ui-monospace, monospace;
    padding-left: 0.35em !important;
}

.ap-auth-submit {
    width: 100%;
    margin-top: 8px;
    padding: 14px 24px;
    border: none;
    border-radius: var(--radius-sm);
    background: var(--navy);
    color: #fff;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 14px rgba(10, 21, 48, 0.2);
    transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}

.ap-auth-submit:hover {
    background: var(--navy-muted);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(10, 21, 48, 0.28);
}

.ap-auth-submit.loading {
    opacity: 0.85;
    pointer-events: none;
}

.ap-auth-submit .spinner {
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: ap-spin 0.7s linear infinite;
    display: none;
}

.ap-auth-submit.loading .spinner {
    display: block;
}

.ap-auth-submit.loading .btn-label,
.ap-auth-submit.loading .btn-icon {
    display: none;
}

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

.ap-auth-back {
    display: block;
    text-align: center;
    margin-top: 16px;
    font-size: 0.875rem;
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 600;
}

.ap-auth-back:hover {
    color: var(--navy);
}

.ap-auth-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
    font-size: 0.8125rem;
    color: var(--text-muted);
}

.ap-auth-footer a {
    color: var(--primary-dark);
    font-weight: 700;
    text-decoration: none;
}

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

.ap-auth-page > .ap-copy {
    position: relative;
    z-index: 1;
    text-align: center;
    padding: 0 16px 24px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.ap-auth-page > .ap-copy .highlight {
    color: var(--navy);
    font-weight: 700;
}

@media (max-width: 899px) {
    .ap-auth-card {
        padding: 28px 22px 24px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .ap-auth-orb,
    .ap-auth-showcase .showcase-badge::before {
        animation: none;
    }
}
