/* =============================================
   BVetter — account-settings.css
   Page: Account settings — profile edit, password, 2FA, deactivation.
   Depends: variables.css (must load first in HTML)
   ============================================= */

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Manrope', sans-serif;
    background: var(--bg-page);
    color: var(--text-primary);
    min-height: 100vh;
}


/* ── PAGE ──────────────────────────────────── */
.page-body {
    max-width: 880px;
    margin: 0 auto;
    padding: 40px 24px 80px;
}

.page-title {
    font-size: 30px;
    font-weight: 900;
    color: var(--color-navy);
    margin-bottom: 4px;
}

.page-sub {
    font-size: 13px;
    color: var(--text-muted);
    margin-bottom: 28px;
    line-height: 1.5;
}


/* ── CARDS ─────────────────────────────────── */
.settings-card {
    background: #fff;
    border-radius: var(--radius-xl);
    border: 1px solid var(--border-default);
    box-shadow: var(--shadow-card);
    margin-bottom: 20px;
    overflow: hidden;
}


/* ── PROFILE CARD ──────────────────────────── */
.profile-card {
    padding: 0;
}

.profile-banner {
    background: var(--gradient-hero);
    padding: 20px 28px 24px;
}

.profile-card-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 16px;
}

.card-title {
    font-size: 16px;
    font-weight: 800;
    color: rgba(255, 255, 255, 0.95);
    margin-bottom: 3px;
}

.card-desc {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    line-height: 1.5;
}

.btn-save {
    padding: 10px 22px;
    background: rgba(255, 255, 255, 0.15);
    border: 1.5px solid rgba(255, 255, 255, 0.4);
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 700;
    font-family: 'Manrope', sans-serif;
    color: #fff;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
    backdrop-filter: blur(8px);
    transition: background 0.2s, border-color 0.2s;
}

.btn-save:hover {
    background: rgba(255, 255, 255, 0.28);
    border-color: rgba(255, 255, 255, 0.7);
}

.profile-body {
    display: flex;
    align-items: flex-start;
    gap: 32px;
    padding: 28px 28px 32px;
}

/* ── AVATAR ─────────────────────────────────── */
.avatar-col {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.avatar-ring {
    padding: 3px;
    border-radius: 50%;
    background: var(--gradient-btn);
    box-shadow: 0 4px 18px rgba(0, 83, 18, 0.25);
}

.avatar-wrap {
    width: 96px;
    height: 96px;
    border-radius: 50%;
    border: 3px solid #fff;
    position: relative;
    cursor: pointer;
    overflow: hidden;
    display: block;
}

.profile-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
    display: block;
}

.avatar-edit-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.52);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.22s ease;
    border-radius: 50%;
}

.avatar-wrap:hover .avatar-edit-overlay {
    opacity: 1;
}

.avatar-edit-text {
    font-size: 10px;
    font-weight: 800;
    color: #fff;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    text-align: center;
}

.avatar-upload-btn {
    background: none;
    border: none;
    cursor: pointer;
    font-family: 'Manrope', sans-serif;
    font-size: 11px;
    font-weight: 700;
    color: var(--color-green-dark);
    padding: 0;
    transition: opacity 0.2s;
}

.avatar-upload-btn:hover {
    opacity: 0.65;
}

.avatar-hint {
    font-size: 10px;
    color: var(--text-faint);
    text-align: center;
    line-height: 1.4;
}


/* ── PROFILE FIELDS ─────────────────────────── */
.profile-fields {
    flex: 1;
    min-width: 0;
}

.fields-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group.full {
    grid-column: 1 / -1;
}

.form-label {
    font-size: 10.5px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.6px;
    text-transform: uppercase;
}

.form-input {
    padding: 11px 14px;
    border: 1.5px solid var(--border-default);
    border-radius: var(--radius-md);
    font-size: 13.5px;
    font-family: 'Manrope', sans-serif;
    color: var(--text-primary);
    background: var(--bg-input);
    outline: none;
    width: 100%;
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.form-input:focus {
    border-color: var(--color-green-dark);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0, 83, 18, 0.09);
}

.form-input::placeholder {
    color: var(--text-faint);
}

.phone-row {
    display: flex;
    gap: 8px;
}

.select-wrap {
    position: relative;
}

.phone-code-wrap {
    flex-shrink: 0;
}

.form-select {
    width: 100%;
    padding: 11px 28px 11px 12px;
    border: 1.5px solid var(--border-default);
    border-radius: var(--radius-md);
    font-size: 13.5px;
    font-family: 'Manrope', sans-serif;
    color: var(--text-primary);
    background: var(--bg-input);
    outline: none;
    appearance: none;
    cursor: pointer;
    transition: border-color 0.2s;
}

.form-select:focus {
    border-color: var(--color-green-dark);
}

.phone-code {
    width: 76px;
}

.phone-num {
    flex: 1;
}

.sel-icon {
    position: absolute;
    right: 9px;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    object-fit: contain;
    pointer-events: none;
    opacity: 0.45;
}


/* ── SECURITY ROW ──────────────────────────── */
.security-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 0;
}

.security-card {
    display: flex;
    flex-direction: column;
    padding: 24px;
}

.sec-icon-wrap {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
    flex-shrink: 0;
}

.sec-icon {
    width: 22px;
    height: 22px;
    object-fit: contain;
}

.lock-bg {
    background: linear-gradient(135deg, #dce9ff 0%, #b3caff 100%);
}

.shield-bg {
    background: linear-gradient(135deg, var(--color-green-light) 0%, #6edb6e 100%);
}

.twofa-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 18px;
}

.twofa-top .sec-icon-wrap {
    margin-bottom: 0;
}

.twofa-badge {
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 0.8px;
    padding: 4px 10px;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
}

.twofa-badge.enabled {
    background: var(--color-green-light);
    color: var(--color-green-dark);
}

.twofa-badge.disabled {
    background: #f0f0f4;
    color: var(--text-muted);
}

.sec-title {
    font-size: 15px;
    font-weight: 800;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.sec-desc {
    font-size: 12.5px;
    color: var(--text-body);
    line-height: 1.65;
    margin-bottom: 20px;
    flex: 1;
}

.btn-sec {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 11px 16px;
    background: var(--bg-input);
    border: 1.5px solid var(--border-default);
    border-radius: var(--radius-md);
    font-size: 12.5px;
    font-weight: 700;
    font-family: 'Manrope', sans-serif;
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
    margin-top: auto;
}

.btn-sec:hover {
    background: #fff;
    border-color: var(--color-green-dark);
    color: var(--color-green-dark);
}

.btn-arrow {
    width: 14px;
    height: 14px;
    object-fit: contain;
    opacity: 0.5;
    transition: opacity 0.2s;
}

.btn-sec:hover .btn-arrow {
    opacity: 0.9;
}


/* ── DANGER ────────────────────────────────── */
.danger-row {
    display: flex;
    justify-content: flex-end;
    margin-top: 12px;
}

.btn-deactivate {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    cursor: pointer;
    font-size: 12.5px;
    font-weight: 700;
    font-family: 'Manrope', sans-serif;
    color: var(--color-red);
    padding: 6px 0;
    transition: opacity 0.2s;
}

.btn-deactivate:hover {
    opacity: 0.7;
}

.danger-icon {
    width: 13px;
    height: 13px;
    object-fit: contain;
}


/* ── MODALS ────────────────────────────────── */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 999;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
}

.modal-overlay.open {
    display: flex;
}

.modal-box {
    background: #fff;
    border-radius: var(--radius-xl);
    padding: 28px 28px 24px;
    max-width: 480px;
    width: 100%;
    box-shadow: var(--shadow-modal);
}

.modal-box.narrow {
    max-width: 400px;
    text-align: center;
}

.modal-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.modal-title {
    font-size: 18px;
    font-weight: 900;
    color: var(--text-primary);
}

.modal-title.center {
    text-align: center;
    margin-bottom: 10px;
}

.modal-close-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    border-radius: var(--radius-sm);
    transition: background 0.15s;
}

.modal-close-btn:hover {
    background: var(--bg-input);
}

.close-icon {
    width: 16px;
    height: 16px;
    object-fit: contain;
    opacity: 0.45;
}

.modal-fields {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-bottom: 20px;
}

.pw-wrap {
    position: relative;
}

.pw-eye {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    padding: 2px;
}

.eye-icon {
    width: 16px;
    height: 16px;
    object-fit: contain;
    opacity: 0.4;
    transition: opacity 0.2s;
}

.pw-eye:hover .eye-icon {
    opacity: 0.8;
}

.pw-wrap .form-input {
    padding-right: 42px;
    background: var(--bg-input);
    border-color: var(--border-default);
}

.pw-wrap .form-input:focus {
    border-color: var(--color-navy);
    background: #fff;
    box-shadow: 0 0 0 3px rgba(0, 42, 88, 0.08);
}

.modal-footer-row {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.modal-footer-row.centered {
    justify-content: center;
}

.modal-icon-wrap {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

.danger-wrap .modal-icon-lg {
    width: 48px;
    height: 48px;
    object-fit: contain;
}

.modal-desc {
    font-size: 13px;
    color: var(--text-muted);
    line-height: 1.65;
    margin-bottom: 20px;
}

.modal-desc.center {
    text-align: center;
}

.btn-modal-cancel {
    padding: 10px 22px;
    background: #fff;
    border: 1.5px solid var(--border-default);
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 700;
    font-family: 'Manrope', sans-serif;
    color: var(--text-body);
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.btn-modal-cancel:hover {
    border-color: var(--text-muted);
    background: var(--bg-input);
}

.btn-modal-confirm {
    padding: 10px 22px;
    background: var(--color-navy);
    border: none;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 700;
    font-family: 'Manrope', sans-serif;
    color: #fff;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-modal-confirm:hover {
    background: var(--color-navy-mid);
}

.btn-modal-danger {
    padding: 10px 22px;
    background: var(--color-red);
    border: none;
    border-radius: var(--radius-md);
    font-size: 13px;
    font-weight: 700;
    font-family: 'Manrope', sans-serif;
    color: #fff;
    cursor: pointer;
    transition: opacity 0.2s;
}

.btn-modal-danger:hover {
    opacity: 0.85;
}


/* ── TOAST ─────────────────────────────────── */
.toast {
    position: fixed;
    bottom: 28px;
    right: 28px;
    background: var(--text-primary);
    color: #fff;
    padding: 12px 20px;
    border-radius: 10px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    transform: translateY(80px);
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
}

.toast.show {
    transform: translateY(0);
    opacity: 1;
}

.toast.success {
    background: var(--color-green-dark);
}

.toast.error {
    background: var(--color-red);
}

/* =============================================
   RESPONSIVE — see public/css/variables.css for
   the shared breakpoint scale used across all pages.
   ============================================= */

/* ── Tablet: 481px – 1024px ─────────────────── */
@media (max-width: 1024px) {
    .page-body { padding: 32px 20px 60px; }

    .profile-card-header { flex-wrap: wrap; gap: 12px; }

    /* Avatar stacks above the fields instead of sitting beside
       them — a 2-col fields-grid can't share space with a fixed
       96px avatar column once the page narrows below ~600px. */
    .profile-body { flex-direction: column; align-items: center; text-align: center; gap: 20px; }

    .avatar-col { align-items: center; }

    /* Only the avatar column should center — the centered text-align
       on .profile-body was bleeding into the field labels/inputs too. */
    .profile-fields { width: 100%; text-align: left; }

    .security-row { grid-template-columns: 1fr; }
}

/* ── Mobile: up to 480px ─────────────────────── */
@media (max-width: 480px) {
    .page-body { padding: 20px 16px 48px; }

    .page-title { font-size: 24px; }

    .profile-banner { padding: 16px 20px 20px; }

    /* Keep the button at its natural width instead of stretching
       full-bleed across the banner — reads better under the title. */
    .profile-card-header { flex-direction: column; align-items: flex-start; }

    .profile-body { padding: 20px; }

    .fields-grid { grid-template-columns: 1fr; }

    .security-card { padding: 18px; }

    .modal-box { padding: 22px 20px 20px; }

    .modal-footer-row { flex-direction: column-reverse; }

    .modal-footer-row button { width: 100%; justify-content: center; }

    .toast { left: 16px; right: 16px; bottom: 16px; }
}
