/* =============================================================
   MOJ RAČUN — Account Settings Panel
   Plugin: Modern Dark Auth | TEHIX.HR
   File:   assets/css/moj-racun.css
   ============================================================= */

/* ── Section wrapper ───────────────────────────────────────── */
.mda-account-section {
    margin-bottom: 8px;
}

.mda-account-section-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
}

.mda-account-section-header .material-symbols-outlined {
    font-size: 20px;
    color: var(--mda-accent, #7c6af7);
}

.mda-account-section-header h3 {
    margin: 0;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: .08em;
    color: #e0e0f0;
    text-transform: uppercase;
}

.mda-account-divider {
    border: none;
    border-top: 1px solid rgba(255, 255, 255, .07);
    margin: 24px 0;
}

/* ── Field grid ────────────────────────────────────────────── */
.mda-account-fields {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.mda-account-row-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 540px) {
    .mda-account-row-2col {
        grid-template-columns: 1fr;
    }
}

/* ── Individual field ──────────────────────────────────────── */
.mda-account-field {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.mda-account-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .08em;
    color: #a0a0c0;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    gap: 8px;
}

/* ── Badges ────────────────────────────────────────────────── */
.mda-account-readonly-badge,
.mda-account-pending-badge {
    font-size: 9px;
    font-weight: 800;
    letter-spacing: .06em;
    padding: 2px 7px;
    border-radius: 20px;
}

.mda-account-readonly-badge {
    background: rgba(120, 120, 160, .2);
    color: #7878a0;
    border: 1px solid rgba(120, 120, 160, .3);
}

.mda-account-pending-badge {
    background: rgba(251, 191, 36, .15);
    color: #fbbf24;
    border: 1px solid rgba(251, 191, 36, .3);
}

/* ── Input wrapper ─────────────────────────────────────────── */
.mda-account-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
    transition: box-shadow .2s;
}

.mda-field-icon {
    position: absolute;
    left: 12px;
    font-size: 18px;
    color: #6060a0;
    pointer-events: none;
    z-index: 1;
    transition: color .2s;
}

/* ── Base input ────────────────────────────────────────────── */
.mda-account-input {
    width: 100%;
    background: rgba(255, 255, 255, .04);
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 10px;
    padding: 11px 14px 11px 40px;
    font-size: 14px;
    color: #e0e0f0;
    transition: border-color .2s, background .2s, box-shadow .2s;
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

.mda-account-input:focus {
    border-color: var(--mda-accent, #7c6af7);
    background: rgba(124, 106, 247, .06);
    box-shadow: 0 0 0 3px rgba(124, 106, 247, .12);
}

.mda-account-input-readonly {
    color: #7070a0;
    cursor: not-allowed;
    background: rgba(255, 255, 255, .02);
}

.mda-readonly-wrap .mda-account-input {
    padding-right: 40px;
}

.mda-lock-icon {
    position: absolute;
    right: 12px;
    font-size: 16px;
    color: #505070;
}

/* ── Field-level state classes (set by JS on the wrapper) ──── */

/* ZELENO - Ispravno */
.mda-account-input-wrap.field-ok .mda-account-input {
    border-color: #22c55e !important;
    background: rgba(34, 197, 94, .05);
    box-shadow: 0 0 8px rgba(34, 197, 94, 0.2);
}

.mda-account-input-wrap.field-ok .mda-field-icon {
    color: #22c55e;
}

/* CRVENO - Greška */
.mda-account-input-wrap.field-error .mda-account-input {
    border-color: #ef4444 !important;
    background: rgba(239, 68, 68, .05);
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.2);
}

.mda-account-input-wrap.field-error .mda-field-icon {
    color: #ef4444;
}

/* PLAVO - Provjera u tijeku */
.mda-account-input-wrap.field-checking .mda-account-input {
    border-color: #a78bfa !important;
    background: rgba(167, 139, 250, .05);
}

.mda-account-input-wrap.field-checking .mda-field-icon {
    color: #a78bfa;
}

/* --- ANIMACIJA TREŠNJE (SHAKE) --- */
.mda-account-input-wrap.mda-shake {
    animation: mda-shake-anim 0.4s cubic-bezier(0.36, 0.07, 0.19, 0.97) both;
}

@keyframes mda-shake-anim {

    10%,
    90% {
        transform: translate3d(-1px, 0, 0);
    }

    20%,
    80% {
        transform: translate3d(2px, 0, 0);
    }

    30%,
    50%,
    70% {
        transform: translate3d(-4px, 0, 0);
    }

    40%,
    60% {
        transform: translate3d(4px, 0, 0);
    }
}

/* ── Select dropdown ───────────────────────────────────────── */
.mda-select-wrap .mda-account-input {
    padding-right: 36px;
    cursor: pointer;
}

.mda-select-arrow {
    position: absolute;
    right: 10px;
    font-size: 20px;
    color: #6060a0;
    pointer-events: none;
}

.mda-account-select option {
    background: #1e1e2e;
    color: #e0e0f0;
}

.mda-hint-warning {
    color: #fbbf24 !important;
}

/* ── Old-password inline verify hint ──────────────────────── */
.mda-pass-verify-label {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .04em;
    display: block;
    min-height: 16px;
    /* reserves space so layout doesn't jump */
    transition: color .2s;
}

.mda-verify-ok {
    color: #22c55e;
}

.mda-verify-error {
    color: #ef4444;
}

.mda-verify-checking {
    color: #a78bfa;
    animation: mda-pulse 1.2s ease-in-out infinite;
}

@keyframes mda-pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: .4;
    }
}

/* ── Password row – 3 equal columns ───────────────────────── */
.mda-account-password-row {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
}

@media (max-width: 640px) {
    .mda-account-password-row {
        grid-template-columns: 1fr;
    }
}

.mda-password-wrap .mda-account-input {
    padding-right: 42px;
}

/* ── Show / hide password toggle ──────────────────────────── */
.mda-pass-toggle {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    color: #6060a0;
    display: flex;
    align-items: center;
    transition: color .15s;
    z-index: 2;
}

.mda-pass-toggle:hover {
    color: #a0a0d0;
}

.mda-pass-toggle .material-symbols-outlined {
    font-size: 18px;
}

/* ── Password strength bar ─────────────────────────────────── */
.mda-pass-strength-bar {
    height: 3px;
    border-radius: 3px;
    background: rgba(255, 255, 255, .08);
    margin-top: 6px;
    overflow: hidden;
}

.mda-pass-strength-fill {
    height: 100%;
    border-radius: 3px;
    width: 0;
    transition: width .3s, background .3s;
}

.mda-pass-strength-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .06em;
    margin-top: 3px;
    display: block;
}

.mda-pass-match-label {
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .06em;
    margin-top: 4px;
    display: block;
}

/* ═══════════════════════════════════════════════════════════════
   SAVE AREA
   Layout: message floats to the left, button is fixed to the
   right. Both sit in the same row so the user sees the
   feedback right next to the action that caused it.
═══════════════════════════════════════════════════════════════ */
.mda-account-actions {
    margin-top: 28px;
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

/* ── Feedback message ──────────────────────────────────────── */
.mda-account-message {
    flex: 1 1 auto;
    min-width: 0;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 600;
    display: none;
    /* JS switches to flex via style.display */
    align-items: center;
    gap: 8px;
    /* Start invisible + slightly below; JS adds .visible to animate in */
    opacity: 0;
    transform: translateY(6px);
    transition: opacity .25s ease, transform .25s ease;
}

.mda-account-message.visible {
    opacity: 1;
    transform: translateY(0);
}

.mda-account-message .mda-msg-icon {
    font-size: 18px;
    flex-shrink: 0;
}

.mda-account-message .mda-msg-text {
    line-height: 1.4;
}

.mda-account-message.success {
    background: rgba(34, 197, 94, .12);
    border: 1px solid rgba(34, 197, 94, .35);
    color: #4ade80;
}

.mda-account-message.error {
    background: rgba(239, 68, 68, .12);
    border: 1px solid rgba(239, 68, 68, .35);
    color: #f87171;
}

.mda-account-message.warning {
    background: rgba(251, 191, 36, .12);
    border: 1px solid rgba(251, 191, 36, .35);
    color: #fbbf24;
}

/* ── Save button ───────────────────────────────────────────── */
.mda-account-save-btn {
    flex-shrink: 0;
    margin-left: auto;
    /* push to the right even when message is absent */
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, #7c6af7, #a78bfa);
    color: #fff;
    border: none;
    border-radius: 10px;
    padding: 12px 28px;
    font-size: 13px;
    font-weight: 800;
    letter-spacing: .08em;
    cursor: pointer;
    transition: opacity .2s, transform .1s, box-shadow .2s;
    box-shadow: 0 4px 14px rgba(124, 106, 247, .3);
}

.mda-account-save-btn:hover {
    opacity: .9;
    box-shadow: 0 6px 20px rgba(124, 106, 247, .45);
}

.mda-account-save-btn:active {
    transform: scale(.97);
}

.mda-account-save-btn:disabled {
    opacity: .45;
    cursor: not-allowed;
    box-shadow: none;
}

.mda-account-save-btn .material-symbols-outlined {
    font-size: 18px;
}

/* ── Mobile: stack vertically ──────────────────────────────── */
@media (max-width: 480px) {
    .mda-account-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .mda-account-save-btn {
        width: 100%;
        justify-content: center;
        margin-left: 0;
    }

    .mda-account-message {
        text-align: center;
        justify-content: center;
    }
}