/* assets/css/public-auth.css */

/* ============================================
   AUTH NAVBAR (minimal)
   ============================================ */
.sg-auth-navbar {
    background: var(--sg-white);
    border-bottom: 1px solid var(--sg-border);
    padding: 0.75rem 0;
}

.sg-auth-nav-container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1.5rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sg-auth-brand {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    text-decoration: none;
    color: var(--sg-black);
}

.sg-auth-brand-icon {
    width: 38px;
    height: 38px;
    background: var(--sg-black);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    overflow: hidden;
}

.sg-auth-brand-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.sg-auth-brand-name {
    font-family: var(--sg-font-display);
    font-weight: 800;
    font-size: 1.2rem;
}

.sg-auth-back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--sg-text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.sg-auth-back-link:hover {
    color: var(--sg-orange);
}

/* ============================================
   AUTH SECTION
   ============================================ */
.sg-auth-section {
    min-height: calc(100vh - 140px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--sg-space-xl) 0;
    background: var(--sg-surface-alt);
}

.sg-auth-section--centered {
    min-height: calc(100vh - 140px);
}

.sg-auth-container {
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* ============================================
   AUTH CARD (split layout)
   ============================================ */
.sg-auth-card {
    display: grid;
    grid-template-columns: 1fr 1.15fr;
    background: var(--sg-white);
    border-radius: var(--sg-radius-lg);
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
    min-height: 560px;
}

/* ============================================
   LEFT: VISUAL SIDE
   ============================================ */
.sg-auth-visual {
    position: relative;
    background: linear-gradient(135deg, var(--sg-black) 0%, #2a2a2a 100%);
    color: var(--sg-white);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2.5rem;
    overflow: hidden;
}

.sg-auth-visual-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
}

.sg-auth-visual-bg::before {
    content: '';
    position: absolute;
    width: 300px;
    height: 300px;
    background: var(--sg-orange);
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.2;
    top: -80px;
    right: -80px;
}

.sg-auth-visual-bg::after {
    content: '';
    position: absolute;
    width: 200px;
    height: 200px;
    background: var(--sg-orange);
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.15;
    bottom: -60px;
    left: -60px;
}

/* Dot pattern overlay */
.sg-auth-visual::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: radial-gradient(rgba(255,255,255,0.06) 1px, transparent 1px);
    background-size: 20px 20px;
    z-index: 1;
}

.sg-auth-visual-content {
    position: relative;
    z-index: 2;
    text-align: center;
}

.sg-auth-visual-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--sg-orange);
    color: var(--sg-black);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    margin: 0 auto 1.5rem;
    box-shadow: 0 8px 30px rgba(247, 148, 30, 0.3);
}

.sg-auth-visual-content h2 {
    font-family: var(--sg-font-display);
    font-weight: 800;
    font-size: 1.75rem;
    margin-bottom: 0.75rem;
}

.sg-auth-visual-content p {
    color: rgba(255, 255, 255, 0.7);
    font-size: 0.925rem;
    line-height: 1.7;
    max-width: 320px;
    margin: 0 auto 2rem;
}

.sg-auth-visual-features {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    text-align: left;
    max-width: 240px;
    margin: 0 auto;
}

.sg-auth-visual-feature {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.85);
}

.sg-auth-visual-feature i {
    color: var(--sg-orange);
    font-size: 1.1rem;
    width: 20px;
    text-align: center;
}

/* ============================================
   RIGHT: FORM SIDE
   ============================================ */
.sg-auth-form-side {
    padding: 2.5rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.sg-auth-form-header {
    margin-bottom: 1.75rem;
}

.sg-auth-form-title {
    font-family: var(--sg-font-display);
    font-weight: 800;
    font-size: 1.5rem;
    color: var(--sg-black);
    margin: 0 0 0.35rem;
}

.sg-auth-form-subtitle {
    font-size: 0.9rem;
    color: var(--sg-text-muted);
    margin: 0;
}

/* ============================================
   FORM FIELDS
   ============================================ */
.sg-auth-field {
    margin-bottom: 1rem;
}

.sg-auth-field .form-label {
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--sg-gray-800);
    margin-bottom: 0.35rem;
}

.sg-auth-field .input-group-text {
    background: var(--sg-off);
    border: 1.5px solid var(--sg-border);
    border-right: none;
    color: var(--sg-text-muted);
    border-radius: var(--sg-radius-pill) 0 0 var(--sg-radius-pill);
    padding: 0.6rem 0.85rem;
}

.sg-auth-field .form-control {
    border: 1.5px solid var(--sg-border);
    border-left: none;
    border-radius: 0 var(--sg-radius-pill) var(--sg-radius-pill) 0;
    padding: 0.6rem 1rem;
    font-size: 0.9rem;
}

.sg-auth-field .form-control:focus {
    border-color: var(--sg-orange);
    box-shadow: none;
}

.sg-auth-field .input-group:focus-within .input-group-text {
    border-color: var(--sg-orange);
    color: var(--sg-orange);
}

.sg-auth-field .input-group:focus-within .form-control {
    border-color: var(--sg-orange);
}

.sg-auth-field .form-control.is-invalid {
    border-color: var(--sg-danger);
}

.sg-auth-field .form-control.is-invalid ~ .input-group-text,
.sg-auth-field:has(.form-control.is-invalid) .input-group-text {
    border-color: var(--sg-danger);
}

/* Password toggle */
.sg-auth-toggle-pwd {
    border: 1.5px solid var(--sg-border);
    border-left: none;
    border-radius: 0 var(--sg-radius-pill) var(--sg-radius-pill) 0;
    background: var(--sg-off);
    color: var(--sg-text-muted);
    padding: 0.6rem 0.85rem;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.sg-auth-toggle-pwd:hover {
    color: var(--sg-orange);
    background: var(--sg-orange-tint);
}

/* When toggle is present, fix border radius */
.sg-auth-field .input-group:has(.sg-auth-toggle-pwd) .form-control {
    border-radius: 0;
}

.sg-auth-field-error {
    font-size: 0.78rem;
    color: var(--sg-danger);
    margin-top: 0.25rem;
    min-height: 1.1em;
    display: block;
}

/* Password strength bar */
.sg-auth-pwd-strength {
    height: 3px;
    background: var(--sg-gray-100);
    border-radius: 2px;
    margin-top: 0.5rem;
    overflow: hidden;
}

.sg-auth-pwd-bar {
    height: 100%;
    width: 0%;
    border-radius: 2px;
    transition: width 0.3s ease, background-color 0.3s ease;
}

.sg-auth-pwd-bar.weak { width: 25%; background: var(--sg-danger); }
.sg-auth-pwd-bar.fair { width: 50%; background: #f0ad4e; }
.sg-auth-pwd-bar.good { width: 75%; background: #5cb85c; }
.sg-auth-pwd-bar.strong { width: 100%; background: var(--sg-success); }

/* Row (side by side fields) */
.sg-auth-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

/* Options row (remember + forgot) */
.sg-auth-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}

.sg-auth-options .form-check-label {
    font-size: 0.85rem;
    color: var(--sg-text-muted);
    cursor: pointer;
}

.sg-auth-options .form-check-input:checked {
    background-color: var(--sg-orange);
    border-color: var(--sg-orange);
}

.sg-auth-forgot-link {
    font-size: 0.85rem;
    color: var(--sg-orange-dark);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s ease;
}

.sg-auth-forgot-link:hover {
    color: var(--sg-orange);
    text-decoration: underline;
}

/* Consent */
.sg-auth-consent {
    margin-bottom: 1.25rem;
}

.sg-auth-consent .form-check-label {
    font-size: 0.82rem;
    color: var(--sg-text-muted);
    line-height: 1.5;
    cursor: pointer;
}

.sg-auth-consent .form-check-input:checked {
    background-color: var(--sg-orange);
    border-color: var(--sg-orange);
}

/* ============================================
   SUBMIT BUTTON
   ============================================ */
.sg-auth-submit-btn {
    background: var(--sg-orange);
    color: var(--sg-black);
    border: none;
    padding: 0.75rem;
    border-radius: var(--sg-radius-pill);
    font-family: var(--sg-font-display);
    font-weight: 700;
    font-size: 0.95rem;
    transition: all 0.25s ease;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    box-shadow: 0 4px 14px rgba(247, 148, 30, 0.3);
}

.sg-auth-submit-btn:hover:not(:disabled) {
    background: var(--sg-orange-dark);
    color: var(--sg-white);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(247, 148, 30, 0.4);
}

.sg-auth-submit-btn:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

/* Alt button (signup/login link) */
.sg-auth-alt-btn {
    background: transparent;
    border: 1.5px solid var(--sg-border);
    color: var(--sg-black);
    padding: 0.7rem;
    border-radius: var(--sg-radius-pill);
    font-family: var(--sg-font-display);
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.25s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.sg-auth-alt-btn:hover {
    border-color: var(--sg-black);
    background: var(--sg-black);
    color: var(--sg-orange);
}

/* Divider */
.sg-auth-divider {
    text-align: center;
    margin: 1.25rem 0;
    position: relative;
}

.sg-auth-divider::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 0;
    right: 0;
    height: 1px;
    background: var(--sg-border);
}

.sg-auth-divider span {
    position: relative;
    background: var(--sg-white);
    padding: 0 1rem;
    font-size: 0.82rem;
    color: var(--sg-text-muted);
}

/* ============================================
   MODALS
   ============================================ */
.sg-auth-modal-content {
    border: none;
    border-radius: var(--sg-radius-lg);
    padding: 2.5rem 2rem;
    text-align: center;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.15);
    position: relative;
}

.sg-auth-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: var(--sg-gray-100);
    border-radius: 50%;
    padding: 0.4rem;
    opacity: 0.6;
    z-index: 10;
}

.sg-auth-modal-close:hover {
    opacity: 1;
    background: var(--sg-gray-300);
}

.sg-auth-modal-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    font-size: 1.75rem;
}

.sg-auth-modal-icon-info {
    background: #e8f4fd;
    color: #2980b9;
}

.sg-auth-modal-icon-success {
    background: #e5f3e8;
    color: var(--sg-success);
}

.sg-auth-modal-icon-error {
    background: #fbeae7;
    color: var(--sg-danger);
}

.sg-auth-modal-title {
    font-family: var(--sg-font-display);
    font-weight: 700;
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
}

.sg-auth-modal-text {
    color: var(--sg-text-muted);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.sg-auth-result-btn {
    background: var(--sg-black);
    color: var(--sg-white);
    border: none;
    padding: 0.6rem 2rem;
    border-radius: var(--sg-radius-pill);
    font-family: var(--sg-font-display);
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.25s ease;
}

.sg-auth-result-btn:hover {
    background: var(--sg-orange);
    color: var(--sg-black);
}

.sg-auth-result-btn-error {
    background: var(--sg-danger);
    color: var(--sg-white);
}

.sg-auth-result-btn-error:hover {
    background: #a93226;
    color: var(--sg-white);
}

/* ============================================
   VERIFY EMAIL CARD
   ============================================ */
.sg-auth-verify-card {
    background: var(--sg-white);
    border-radius: var(--sg-radius-lg);
    padding: 3rem 2.5rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.08);
    text-align: center;
    max-width: 520px;
    margin: 0 auto;
}

.sg-auth-verify-state {
    animation: sgAuthFadeIn 0.4s ease;
}

@keyframes sgAuthFadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.sg-auth-verify-state h3 {
    font-family: var(--sg-font-display);
    font-weight: 700;
    font-size: 1.4rem;
    margin-bottom: 0.75rem;
}

.sg-auth-verify-state p {
    color: var(--sg-text-muted);
    font-size: 0.925rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.sg-auth-verify-icon {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
    font-size: 2rem;
}

.sg-auth-verify-icon-success {
    background: #e5f3e8;
    color: var(--sg-success);
}

.sg-auth-verify-icon-error {
    background: #fbeae7;
    color: var(--sg-danger);
}

.sg-auth-verify-icon-info {
    background: #e8f4fd;
    color: #2980b9;
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 767px) {
    .sg-auth-card {
        grid-template-columns: 1fr;
    }

    .sg-auth-visual {
        display: none; /* Hide visual side on mobile */
    }

    .sg-auth-form-side {
        padding: 2rem 1.5rem;
    }

    .sg-auth-row {
        grid-template-columns: 1fr;
    }

    .sg-auth-container {
        padding: 0 1rem;
    }

    .sg-auth-verify-card {
        padding: 2rem 1.5rem;
    }
}

@media (max-width: 480px) {
    .sg-auth-form-side {
        padding: 1.5rem 1.25rem;
    }

    .sg-auth-options {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}