/**
 * Common Auth Pages Styles
 * Shared styles for all authentication pages (login, register, forgot password, etc.)
 */

/* Base font family */
* {
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

:root {
    --brand: #e55800;
    --brand-hover: #d25100;
    --dark: #0b1320;
    --muted: #6b7280;
}

.auth-page {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 0.5rem;
    position: relative;
    overflow: hidden;
}

.auth-page::before {
    content: "";
    position: absolute;
    top: -10%;
    right: -5%;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(229,88,0,0.08) 0%, transparent 70%);
    pointer-events: none;
}

.auth-page::after {
    content: "";
    position: absolute;
    bottom: -10%;
    left: -5%;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(229,88,0,0.05) 0%, transparent 70%);
    pointer-events: none;
}

.auth-card {
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.08);
    padding: 1.25rem;
    width: 100%;
    max-width: 480px;
    position: relative;
    z-index: 1;
    border: 1px solid rgba(0,0,0,0.06);
    max-height: calc(100vh - 1rem);
    overflow-y: auto;
}

.auth-header {
    position: relative;
    text-align: center;
    margin-bottom: 1rem;
    min-height: 2.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
}

.auth-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(229,88,0,0.1);
    color: var(--brand);
    padding: 0.3rem 0.7rem;
    border-radius: 50px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.auth-title {
    color: var(--dark);
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 0.3rem;
}

.auth-subtitle {
    color: var(--muted);
    font-size: 0.88rem;
}

/* Form Elements */
.auth-form-group {
    margin-bottom: 0.85rem;
}

.auth-label {
    display: flex;
    align-items: center;
    color: var(--dark);
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 0.45rem;
    gap: 0.35rem;
}

.auth-label .bi {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    vertical-align: middle;
    line-height: 1;
}

.auth-input {
    width: 100%;
    max-width: 100%;
    padding: 0.7rem 0.85rem;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    font-size: 0.9rem;
    transition: all 0.2s;
    background: #fff;
    box-sizing: border-box;
}

.auth-input:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(229,88,0,0.1);
}

.auth-input.is-invalid {
    border-color: #dc2626;
}

.auth-password-wrapper {
    position: relative;
    display: block;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.auth-password-wrapper .auth-input {
    padding-right: 3rem;
}

.auth-password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none !important;
    border: none !important;
    color: #e55800 !important;
    cursor: pointer;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: none;
    z-index: 10;
    outline: none !important;
    box-shadow: none !important;
    -webkit-tap-highlight-color: transparent;
}

.auth-password-toggle:hover {
    color: #d25100 !important;
    background: none !important;
    border: none !important;
}

.auth-password-toggle:active,
.auth-password-toggle:focus,
.auth-password-toggle:focus-visible {
    background: none !important;
    border: none !important;
    outline: none !important;
    color: #e55800 !important;
    box-shadow: none !important;
}

.auth-password-toggle i {
    font-size: 1.1rem;
}

.auth-btn {
    width: 100%;
    padding: 0.75rem 0.95rem;
    background: var(--brand);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    transition: all 0.2s;
    margin-top: 0.5rem;
}

.auth-btn:hover:not(:disabled) {
    background: var(--brand-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(229,88,0,0.25);
}

.auth-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.auth-btn .bi {
    color: #fff;
    font-size: 1rem;
}

.btn-group-auth {
    display: flex;
    gap: 0.75rem;
    margin-top: 1rem;
}

.btn-group-auth .auth-btn {
    flex: 1;
    margin-top: 0;
}

.auth-links {
    margin-top: 1rem;
    text-align: center;
    font-size: 0.9rem;
}

.auth-link {
    color: var(--brand);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}

.auth-link:hover {
    color: var(--brand-hover);
    text-decoration: underline;
}

.auth-separator {
    color: var(--muted);
    margin: 0 0.5rem;
}

.invalid-feedback {
    display: block;
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875em;
    color: #dc2626;
}

.auth-hint {
    font-size: 0.8rem;
    color: var(--muted);
    margin-top: 0.35rem;
}

/* Alerts */
.alert {
    padding: 0.75rem 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
    display: flex;
    align-items: flex-start;
    gap: 0.65rem;
    font-size: 0.85rem;
    max-height: 200px;
    overflow-y: auto;
}

.alert-dismissible {
    cursor: pointer;
    transition: opacity 0.15s linear;
}

.alert-success {
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.2);
    color: #065f46;
}

.alert-info {
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    color: #1e40af;
}

.alert-danger {
    background: rgba(220, 38, 38, 0.1);
    border: 1px solid rgba(220, 38, 38, 0.2);
    color: #991b1b;
}

.alert .btn-close {
    margin-left: auto;
    opacity: 0.5;
}

.alert .btn-close:hover {
    opacity: 1;
}

/* OTP Boxes */
.otp-container {
    display: flex;
    gap: 0.65rem;
    justify-content: center;
    margin: 1rem 0;
}

.otp-box {
    width: 46px;
    height: 52px;
    text-align: center;
    font-size: 1.3rem;
    font-weight: 600;
    border: 2px solid #e5e7eb;
    border-radius: 10px;
    background: #fff;
    transition: all 0.2s;
    color: var(--dark);
}

.otp-box:focus {
    outline: none;
    border-color: var(--brand);
    box-shadow: 0 0 0 4px rgba(229,88,0,0.1);
}

.otp-box.is-invalid {
    border-color: #dc2626;
    animation: shake 0.3s;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* OTP Page specific styles */
.auth-page-otp {
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    padding-top: 0.5rem;
}

.auth-page-otp > .container {
    margin-top: 0 !important;
    padding-top: 0.75rem !important;
    width: 100%;
}

.auth-page-otp .auth-container {
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: calc(100vh - 120px);
}

/* OTP Info Box */
.auth-info-box {
    text-align: center;
    margin-bottom: 1.5rem;
}

.auth-info-box p {
    font-size: 0.9rem;
    line-height: 1.6;
    color: var(--dark);
}

.auth-info-box p strong {
    color: var(--brand);
    font-weight: 600;
}

.auth-info-box .text-muted {
    color: var(--muted);
    font-size: 0.85rem;
}

/* OTP Label with icon */
.auth-form-group .auth-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 0.9rem;
    color: var(--dark);
    font-weight: 500;
    margin-bottom: 0.75rem;
}

.auth-form-group .auth-label .bi {
    font-size: 1rem;
    color: var(--brand);
}

/* Resend Section */
.auth-resend-section {
    text-align: center;
    margin-top: 1.5rem;
}

.auth-link-btn {
    background: none;
    border: none;
    color: var(--brand);
    text-decoration: none;
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    padding: 0;
    transition: color 0.2s;
}

.auth-link-btn:hover:not(:disabled) {
    color: var(--brand-hover);
    text-decoration: underline;
}

.auth-link-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    text-decoration: none;
}

.auth-resend-btn {
    color: var(--brand);
    font-weight: 600;
}

.auth-resend-btn:hover:not(:disabled) {
    color: var(--brand-hover);
}

#resendCountdown {
    font-size: 0.85rem;
    color: var(--muted);
}

/* Breadcrumb Styles */
.breadcrumb {
    --bs-breadcrumb-padding-x: 0;
    --bs-breadcrumb-padding-y: 0;
    --bs-breadcrumb-margin-bottom: 1rem;
    --bs-breadcrumb-bg: ;
    --bs-breadcrumb-border-radius: ;
    --bs-breadcrumb-divider-color: var(--bs-secondary-color);
    --bs-breadcrumb-item-padding-x: 0.5rem;
    --bs-breadcrumb-item-active-color: var(--bs-secondary-color);
    display: flex;
    flex-wrap: wrap;
    padding: var(--bs-breadcrumb-padding-y) var(--bs-breadcrumb-padding-x);
    margin-bottom: var(--bs-breadcrumb-margin-bottom);
    font-size: var(--bs-breadcrumb-font-size);
    list-style: none;
    background-color: var(--bs-breadcrumb-bg);
    border-radius: var(--bs-breadcrumb-border-radius);
}

.breadcrumb-item + .breadcrumb-item {
    padding-left: var(--bs-breadcrumb-item-padding-x);
}

.breadcrumb-item + .breadcrumb-item::before {
    float: left;
    padding-right: var(--bs-breadcrumb-item-padding-x);
    color: var(--bs-breadcrumb-divider-color);
    content: var(--bs-breadcrumb-divider, "/");
}

.breadcrumb-item.active {
    color: #6b7280;
}

.breadcrumb-item a {
    color: var(--brand);
    text-decoration: none;
    transition: color 0.2s;
}

.breadcrumb-item a:hover {
    color: var(--brand-hover);
    text-decoration: underline;
}

.breadcrumb-item a .bi {
    color: var(--brand);
    fill: var(--brand);
}

.breadcrumb-item a:hover .bi {
    color: var(--brand-hover);
    fill: var(--brand-hover);
}

/* Responsive */
@media (max-width: 575.98px) {
    .auth-card {
        padding: 1rem;
        max-width: 100%;
    }
    
    .auth-title {
        font-size: 1.1rem;
    }

    .otp-box {
        width: 40px;
        height: 46px;
        font-size: 1.1rem;
    }

    .otp-container {
        gap: 0.5rem;
    }

    .breadcrumb {
        font-size: 0.75rem;
    }

    .breadcrumb-item {
        padding: 0.25rem 0;
        padding-left: 0.375rem;
    }

    .breadcrumb-item + .breadcrumb-item::before {
        font-size: 0.7rem;
        padding-right: 0.375rem;
    }

    .breadcrumb-item a {
        font-size: 0.75rem;
    }
}

