/* Auth Pages Styling - Minimalist Overhaul */
.auth-page-container {
    min-height: 100vh;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    background: var(--background);
    padding: clamp(2rem, 8vw, 6rem) 1.5rem;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif !important;
}



/* Restore global sizing within auth pages */
.auth-page-container * {
    box-sizing: border-box;
}

.profile-card {
    background: var(--card-bg);
    padding: clamp(1.5rem, 5vw, 3rem);
    border: 2px solid var(--border-color);
    width: 100%;
    box-sizing: border-box;
    color: var(--text-color);
}

/* Card Size Variants */
.card-sm {
    max-width: 450px;
}

.card-md {
    max-width: 650px;
}

.card-lg {
    max-width: 1400px;
}

.card-xl {
    max-width: 1600px;
}

@media (max-width: 1150px) {
    .card-lg {
        max-width: 1000px;
    }

}

.profile-card-header {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 2.5rem;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 1rem;
    gap: 1rem;
}

.header-title-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
    /* Allow truncation */
}

.header-title {
    font-size: 0.85rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    margin: 0 !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.auth-title {
    font-family: 'Inter', sans-serif;
    font-weight: 900;
    font-size: 1.8rem;
    color: var(--text-color);
    text-align: center;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: -0.5px;
}

.auth-subtitle {
    text-align: center;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    font-size: 0.9rem;
    font-weight: 400;
}

.auth-link {
    color: var(--text-color);
    text-decoration: underline;
    font-weight: 600;
    text-underline-offset: 4px;
    transition: opacity 0.2s;
}

.auth-link:hover {
    opacity: 0.7;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-group {
    position: relative;
    width: 100%;
}

.form-label {
    position: absolute;
    top: 0.8rem;
    left: 1.2rem;
    font-size: 0.65rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--text-secondary);
    pointer-events: none;
    z-index: 10;
}

.form-input {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    padding: 1.8rem 1.1rem 0.4rem 1.2rem;
    /* Strategic padding for top label */
    border: 1px solid var(--input-border);
    background: var(--input-bg);
    font-size: 0.9rem;
    color: var(--text-color);
    border-radius: 0;
    transition: all 0.2s ease-in-out;
    outline: none;
    min-height: 3.5rem;
    display: flex;
    align-items: flex-end;
    margin-bottom: 0.5rem;
    overflow: hidden;
}

.form-input.w-full {
    width: 100% !important;
}

.form-input-readonly {
    background: var(--background) !important;
    opacity: 0.8;
    cursor: default;
    border-color: transparent !important;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.form-input-editable {
    border-color: var(--accent) !important;
    background: var(--card-bg) !important;
}

.form-input-editable:focus {
    border-color: var(--text-color) !important;
    box-shadow: inset 0 0 0 1px var(--text-color);
}

.auth-button {
    background: var(--text-color);
    color: var(--background);
    border: 1px solid var(--text-color);
    padding: 1.1rem;
    border-radius: 4px;
    font-weight: 700;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-sizing: border-box;
    min-height: 4.2rem;
    margin-bottom: 0.5rem;
}

.auth-button-container {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}

.auth-button:hover:not(:disabled) {
    background: var(--accent);
    border-color: var(--accent);
    color: #ffffff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* Secondary Button (White) */
.auth-button.secondary {
    background: var(--card-bg);
    color: var(--text-color);
    border-color: var(--border-color);
    margin-bottom: 0.5rem;
}

.auth-button.secondary:hover:not(:disabled) {
    background: var(--background);
    border-color: var(--text-color);
    color: var(--text-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
}

.auth-button.google {
    background: var(--card-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    text-transform: none;
    font-weight: 600;
    letter-spacing: 0.25px;
    gap: 0.75rem;
}

.auth-button.google:hover:not(:disabled) {
    background: var(--background);
    border-color: var(--text-color);
    color: var(--text-color);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transform: translateY(-1px);
}

.auth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.5rem 0;
    color: var(--text-secondary);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    border-bottom: 1px solid var(--border-color);
}

.auth-divider:not(:empty)::before {
    margin-right: 1rem;
}

.auth-divider:not(:empty)::after {
    margin-left: 1rem;
}

.btn-admin {
    width: auto !important;
    padding: 0 1.5rem !important;
    font-size: 0.75rem !important;
    min-height: 3rem !important;
    display: flex !important;
    align-items: center !important;
    border-color: var(--text-color) !important;
    flex-shrink: 0;
}

/* Success Variant (Green) */
.auth-button.success {
    background: #10b981;
    border-color: #10b981;
    color: #ffffff;
}

.auth-button.success:hover:not(:disabled) {
    background: #059669;
    border-color: #059669;
}

/* Danger Variant (Red) */
.auth-button.danger {
    background: #ef4444;
    border-color: #ef4444;
    color: #ffffff;
}

.auth-button.danger:hover:not(:disabled) {
    background: #b91c1c;
    /* Deeper red */
    border-color: #b91c1c;
}

.auth-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.auth-error {
    background: #fef2f2;
    color: #b91c1c;
    padding: 1.1rem;
    border-radius: 0;
    font-size: 0.85rem;
    text-align: center;
    border: 1px solid #ef4444;
    margin-bottom: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    box-sizing: border-box;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.auth-success {
    background: #f0fdf4 !important;
    color: #166534 !important;
    border: 1px solid #10b981 !important;
    padding: 1.1rem;
    text-align: center;
    margin-bottom: 2rem;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    box-sizing: border-box;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* Profile Grid Overhaul */
.profile-main-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    align-items: stretch;
}

@media (max-width: 1150px) {
    .profile-main-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

@media (max-width: 640px) {
    .auth-page-container {
        padding: 1rem;
    }

    .auth-title {
        font-size: 1.8rem !important;
    }
}

/* Profile Form Layout */
.profile-details-column {
    width: 100%;
}

.profile-form-grid {
    display: flex;
    flex-direction: column;
    width: 100%;
    gap: 0.5rem;
    margin-top: 1rem;
}

.profile-form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    max-width: auto;
}

@media (max-width: 850px) {
    .profile-form-row {
        grid-template-columns: 1fr;
        gap: 0.5rem;
        width: 100%;
    }
}

/* Settings Internal Grid */
.settings-internal-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
    width: 100%;
    align-items: stretch;
}

.settings-internal-grid>div {
    height: 100%;
    display: flex;
    flex-direction: column;
}

.settings-internal-grid>div>div:first-child {
    flex-grow: 1;
}

@media (max-width: 850px) {
    .settings-internal-grid {
        grid-template-columns: 1fr;
    }
}

.settings-expanded {
    grid-column: span 2 !important;
}

.settings-box {
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    transition: all 0.3s ease;
}

.settings-box-highlight {
    background: var(--background);
}

.settings-title-small {
    font-family: 'Inter', sans-serif;
    font-weight: 900;
    text-transform: uppercase;
    font-size: 0.85rem;
    letter-spacing: 0.05em;
    margin-bottom: 0.5rem;
    color: var(--text-color);
}

.settings-text-small {
    font-size: 0.75rem;
    color: var(--text-secondary);
    line-height: 1.6;
}

@media (max-width: 768px) {
    .settings-internal-grid {
        grid-template-columns: 1fr;
    }

    .settings-expanded {
        grid-column: span 1 !important;
    }
}

.logout-section {
    padding-top: 1rem;
    border-top: 2px solid var(--border-color);
}

/* Modal Styling - Minimalist */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: var(--card-bg);
    padding: 3rem;
    width: 100%;
    max-width: 500px;
    position: relative;
    border: 1px solid var(--border-color);
    color: var(--text-color);
}

.modal-close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: none;
    border: none;
    font-size: 2rem;
    color: #444;
    cursor: pointer;
    line-height: 1;
}

.modal-close:hover {
    color: var(--accent);
}

.modal-title {
    font-family: 'Inter', sans-serif;
    font-weight: 900;
    font-size: 1.4rem;
    margin-bottom: 2rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

@media (max-width: 480px) {
    .profile-card {
        padding: 1.5rem;
    }
}

.success-notice-div {
    width: 100%;
    padding: 1.1rem;
    background: #f0fdf4;
    border: 1px solid #10b981;
    color: #047857;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin-bottom: 2rem;
}

.error-notice-div {
    width: 100%;
    padding: 1.1rem;
    background: #fef2f2;
    border: 1px solid #ef4444;
    color: #b91c1c;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    margin-bottom: 2rem;
}

/* Green flash animation for form */
@keyframes greenFlash {
    0% {
        background: var(--card-bg);
        border-color: var(--border-color);
    }

    50% {
        background: #f0fdf4;
        border-color: #10b981;
        box-shadow: 0 0 0 1px rgba(16, 185, 129, 0.3);
    }

    100% {
        background: var(--card-bg);
        border-color: var(--border-color);
        box-shadow: none;
    }
}

.green-flash {
    animation: greenFlash 1s ease;
}

/* Compact copy success overlay */
.copy-success-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(240, 253, 244, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    animation: overlayFade 1.5s ease forwards;
    padding: 0.5rem;
}

@keyframes overlayFade {
    0% {
        opacity: 0;
    }

    20% {
        opacity: 1;
    }

    80% {
        opacity: 1;
    }

    100% {
        opacity: 0;
        visibility: hidden;
    }
}

/* Compact success message box */
.success-message-box {
    background: var(--card-bg);
    border: 1px solid #10b981;
    padding: 0.375rem 0.75rem;
    border-radius: 3px;
    display: flex;
    align-items: center;
    gap: 0.375rem;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    max-width: 90%;
}

.success-message-box svg {
    flex-shrink: 0;
    width: 0.75rem;
    height: 0.75rem;
}

.success-message-box span {
    font-size: 0.625rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #10b981;
    white-space: nowrap;
}

.btn-link-raw {
    background: none !important;
    border: none !important;
    padding: 0 !important;
    font: inherit !important;
    cursor: pointer !important;
}

.form-select-raw {
    appearance: none !important;
    background: var(--input-bg) !important;
}

.qr-code-img {
    border: 8px solid #ffffff;
    background: #ffffff;
    width: 180px;
    height: 180px;
    display: block;
    margin: 0 auto;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

/* QR stays white/white for scanning reliability usually, but we could add a slight border if needed */

.status-badge {
    font-weight: 900;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 1px;
}

.status-verified {
    color: #10b981;
}

.status-unverified {
    color: #ef4444;
}

.header-icon {
    color: var(--text-color);
}

.header-icon:hover {
    color: var(--accent);
}

/* Checkbox Styling */
.form-checkbox-group {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1rem 0;
    cursor: pointer;
    user-select: none;
}

.form-checkbox-group label {
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    cursor: pointer;
}

.form-checkbox {
    appearance: none;
    width: 1.25rem;
    height: 1.25rem;
    border: 2px solid var(--border-color);
    background: var(--input-bg);
    cursor: pointer;
    position: relative;
    transition: all 0.2s;
}

.form-checkbox:checked {
    background: var(--text-color);
    border-color: var(--text-color);
}

.form-checkbox:checked::after {
    content: '✓';
    position: absolute;
    color: var(--background);
    font-size: 0.9rem;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

/* Admin Card Styling */
.admin-nav-card {
    border: 1px solid var(--border-color);
    background: var(--card-bg);
    padding: 2rem;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    border-radius: 8px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.admin-nav-card:hover {
    border-color: var(--text-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.admin-nav-card h4 {
    color: var(--text-color);
}

.admin-nav-card p {
    color: var(--text-secondary);
}