/* ============================================================================
   Auth Pages — Login / Register (reseller.ba dizajn v3)
   ----------------------------------------------------------------------------
   Paleta: #F4F5FA (podloga) · #D4EAFF (ledeni akcenti) · #F1FF62 (volt detalji)
           #112358 (navy). Bez bordera, blago zaobljeno, Sora + Inter.
   Svi selektori starog auth.css su zadržani — markup ostaje kompatibilan.
   ============================================================================ */

:root {
    --mist:  #F4F5FA;
    --ice:   #D4EAFF;
    --volt:  #F1FF62;
    --navy:  #112358;
    --navy-hover: #1B3576;

    --primary: #112358;
    --primary-dark: #1B3576;
    --primary-light: #D4EAFF;
    --secondary: #1B3576;
    --success: #16a34a;
    --danger: #dc2626;

    --text-dark:  #112358;
    --text-body:  #4E5B7A;
    --text-muted: #8A94AD;
    --text-light: #C6D3EE;

    --bg-white: #ffffff;
    --bg-light: #F4F5FA;
    --border: transparent; /* bez bordera — zadržano zbog kompatibilnosti */

    --radius-sm: 12px;
    --radius: 16px;
    --radius-lg: 24px;
    --radius-full: 9999px;

    --shadow-sm: 0 6px 18px -12px rgba(17, 35, 88, 0.16);
    --shadow-md: 0 14px 34px -20px rgba(17, 35, 88, 0.18);
    --shadow-lg: 0 22px 46px -22px rgba(17, 35, 88, 0.24);

    --font-body: 'Inter', 'Sora', system-ui, -apple-system, sans-serif;
    --font-display: 'Sora', 'Inter', system-ui, sans-serif;
    --transition: 0.2s ease;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-font-smoothing: antialiased; }
body.auth-page { font-family: var(--font-body); font-size: 16px; line-height: 1.6; color: var(--text-body); background: var(--mist); min-height: 100vh; }
a { color: var(--navy); text-decoration: none; transition: color var(--transition); }
a:hover { color: var(--navy-hover); }

:focus-visible { outline: 3px solid var(--navy); outline-offset: 2px; border-radius: 6px; }
::selection { background: var(--volt); color: var(--navy); }

/* ============================================================ AUTH CONTAINER */
.auth-container { display: grid; grid-template-columns: 1fr 1fr; min-height: 100vh; }

/* ============================================================ LIJEVI PANEL (navy ploča) */
.auth-left {
    position: relative;
    background:
        radial-gradient(560px 360px at 108% 10%, rgba(212, 234, 255, 0.14), transparent 60%),
        radial-gradient(420px 320px at -6% 110%, rgba(241, 255, 98, 0.10), transparent 55%),
        var(--navy);
    padding: 40px;
    display: flex; flex-direction: column;
    overflow: hidden;
}
.auth-brand { position: relative; z-index: 2; display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px; }
.auth-logo { display: inline-flex; align-items: center; gap: 10px; font-family: var(--font-display); font-weight: 700; font-size: 20px; color: #fff; }
.auth-logo i { font-size: 24px; }
.auth-logo:hover { color: #fff; }
.auth-logo .logo-img { width: 200px; height: auto; max-width: 100%; }
.auth-left-content { position: relative; z-index: 2; margin: auto 0; max-width: 420px; }
.auth-left-content h2 { font-family: var(--font-display); font-size: 36px; font-weight: 700; color: #fff; line-height: 1.2; margin-bottom: 16px; letter-spacing: -0.02em; }
.auth-left-content p { font-size: 16px; color: rgba(255, 255, 255, 0.78); line-height: 1.7; margin-bottom: 24px; }
.auth-benefits { list-style: none; }
.auth-benefits li { display: flex; align-items: center; gap: 12px; color: rgba(255, 255, 255, 0.9); font-size: 15px; font-weight: 500; padding: 8px 0; }
.auth-benefits li i { color: var(--navy); background: var(--volt); border-radius: var(--radius-full); width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; font-size: 11px; flex-shrink: 0; }
.auth-left-shapes { position: absolute; inset: 0; pointer-events: none; overflow: hidden; }
.auth-shape { position: absolute; border-radius: 50%; background: rgba(212, 234, 255, 0.07); }
.auth-shape-1 { width: 400px; height: 400px; bottom: -100px; right: -100px; }
.auth-shape-2 { width: 250px; height: 250px; top: -50px; right: 50%; background: rgba(241, 255, 98, 0.05); }

/* LANG SWITCHER AUTH (pilula na navy) */
.lang-switcher-auth { display: flex; gap: 3px; padding: 4px; background: rgba(255, 255, 255, 0.08); border-radius: var(--radius-full); }
.lang-switcher-auth .lang-btn { padding: 5px 11px; font-size: 12px; font-weight: 600; color: rgba(255, 255, 255, 0.6); border-radius: var(--radius-full); transition: all 0.2s ease; }
.lang-switcher-auth .lang-btn:hover { color: #fff; background: rgba(255, 255, 255, 0.14); }
.lang-switcher-auth .lang-btn.active { color: var(--navy); background: var(--volt); }

/* ============================================================ DESNI PANEL (forma) */
.auth-right { display: flex; align-items: center; justify-content: center; padding: 40px; background: var(--mist); }
.auth-right-scroll { align-items: flex-start; overflow-y: auto; padding-top: 48px; padding-bottom: 48px; }
.auth-form-wrapper { width: 100%; max-width: 520px; background: var(--bg-white); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); padding: 40px 42px; }
.auth-form-wrapper h1 { font-family: var(--font-display); font-size: 27px; font-weight: 700; color: var(--text-dark); margin-bottom: 8px; letter-spacing: -0.02em; }
.auth-subtitle { font-size: 15px; color: var(--text-muted); margin-bottom: 26px; }

/* ============================================================ ALERTS (bez bordera) */
.alert { display: flex; gap: 12px; padding: 15px 18px; border-radius: var(--radius); margin-bottom: 20px; font-size: 14px; line-height: 1.5; }
.alert i { margin-top: 2px; flex-shrink: 0; }
.alert p { margin: 0; }
.alert-error { background: #FDF1F1; color: #991b1b; }
.alert-error i { color: var(--danger); }
.alert-success { background: #EFFBF3; color: #166534; }
.alert-success i { color: var(--success); }
.alert-warning { background: #FFF9E8; color: #92400e; }
.alert-warning i { color: #d97706; }
.alert-warning code { display: block; margin-top: 8px; padding: 8px 12px; background: rgba(17, 35, 88, 0.06); border-radius: 8px; font-family: 'Consolas', monospace; font-size: 12px; word-break: break-all; }

/* ============================================================ FORME (bez bordera — mist polja) */
.auth-form { display: flex; flex-direction: column; gap: 14px; }
.form-group { display: flex; flex-direction: column; gap: 6px; }
.form-group label { font-family: var(--font-display); font-size: 13.5px; font-weight: 600; color: var(--text-dark); }
.form-group .req { color: var(--danger); }
.form-group input, .form-group textarea, .form-group select {
    font-family: var(--font-body); font-size: 14px;
    padding: 13px 16px;
    border: none; border-radius: var(--radius-sm);
    background: var(--mist); color: var(--text-dark);
    transition: background var(--transition), box-shadow var(--transition);
    outline: none; width: 100%;
}
.form-group input::placeholder, .form-group textarea::placeholder { color: var(--text-muted); }
.form-group input:focus, .form-group textarea:focus, .form-group select:focus { background: var(--bg-white); box-shadow: 0 0 0 3px rgba(241, 255, 98, 0.8), var(--shadow-sm); }
.form-group textarea { resize: vertical; }
.form-hint { font-size: 12px; color: var(--text-muted); }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.input-icon { position: relative; }
.input-icon i { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-muted); font-size: 14px; pointer-events: none; }
.input-icon input { padding-left: 40px; }

/* ============================================================ BUTTONS */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 9px; font-family: var(--font-display); font-weight: 600; font-size: 14px; line-height: 1; padding: 14px 26px; border-radius: var(--radius-full); border: none; cursor: pointer; transition: background var(--transition), color var(--transition), transform var(--transition), box-shadow var(--transition); }
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--navy); color: #fff; }
.btn-primary:hover { background: var(--navy-hover); color: #fff; }
.btn-block { width: 100%; }
.btn-lg { padding: 17px 32px; font-size: 15px; }

/* ============================================================ AUTH FOOTER */
.auth-footer { margin-top: 22px; text-align: center; }
.auth-footer p { font-size: 14px; color: var(--text-muted); margin-bottom: 8px; }
.auth-footer a { font-weight: 600; }
.auth-footer a:hover { text-decoration: underline; }

/* ============================================================ ACCOUNT TYPE TOGGLE (bez bordera) */
.account-type-toggle { display: flex; gap: 10px; }
.at-option { cursor: pointer; flex: 1; }
.at-option input { display: none; }
.at-option span { display: flex; align-items: center; justify-content: center; gap: 8px; padding: 13px 16px; background: var(--mist); border-radius: var(--radius-sm); font-family: var(--font-display); font-size: 14px; font-weight: 600; color: var(--text-body); transition: all 0.2s ease; }
.at-option span i { font-size: 15px; color: var(--text-muted); transition: color 0.2s ease; }
.at-option span:hover { background: var(--ice); color: var(--navy); }
.at-option input:checked + span { background: var(--ice); color: var(--navy); box-shadow: inset 0 0 0 2px var(--navy); }
.at-option input:checked + span i { color: var(--navy); }

/* Registracija — polja po tipu naloga (company/individual) */
.account-fields { display: flex; flex-direction: column; gap: 14px; }
.account-fields[data-account] { margin: 0; }

/* ============================================================ SEARCHABLE DROPDOWN (država + telefonski kod) */
.country-slot, .phone-code-slot { position: relative; }
.ss-btn { display: flex; align-items: center; gap: 10px; width: 100%; padding: 13px 16px; font-size: 14px; font-family: var(--font-body); color: var(--text-dark); background: var(--mist); border: none; border-radius: var(--radius-sm); cursor: pointer; text-align: left; transition: background 0.15s ease, box-shadow 0.15s ease; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ss-btn span { overflow: hidden; text-overflow: ellipsis; }
.ss-btn:hover { background: var(--ice); }
.ss-btn:focus { outline: none; background: var(--bg-white); box-shadow: 0 0 0 3px rgba(241, 255, 98, 0.8), var(--shadow-sm); }
.ss-panel { position: absolute; top: calc(100% + 6px); left: 0; z-index: 50; width: 100%; min-width: 260px; background: var(--bg-white); border-radius: var(--radius); box-shadow: var(--shadow-lg); padding: 8px; }
.ss-search { width: 100%; padding: 10px 13px; margin-bottom: 6px; font-size: 14px; font-family: var(--font-body); border: none; border-radius: 10px; background: var(--mist); }
.ss-search:focus { outline: none; background: var(--bg-white); box-shadow: 0 0 0 3px rgba(241, 255, 98, 0.8); }
.ss-list { max-height: 240px; overflow-y: auto; display: flex; flex-direction: column; }
.ss-option { display: flex; align-items: center; gap: 10px; width: 100%; padding: 10px 12px; font-size: 14px; font-family: var(--font-body); color: var(--text-dark); background: transparent; border: 0; border-radius: 10px; cursor: pointer; text-align: left; transition: background 0.15s ease; }
.ss-option:hover { background: var(--ice); }
.ss-option.active { background: var(--volt); color: var(--navy); font-weight: 600; }

/* Telefon: kod + broj u jednom redu */
.phone-input-group { display: grid; grid-template-columns: 45% 1fr; gap: 8px; align-items: start; }
.phone-input-group .ss-btn { padding: 13px 10px; }
.phone-input-group .ss-panel { min-width: 300px; }

/* Zastavice (flagcdn slike) u dropdownima */
.ss-flag { display: inline-block; width: 20px; height: 15px; border-radius: 3px; box-shadow: 0 0 0 1px rgba(17, 35, 88, 0.1); flex-shrink: 0; }

/* Regija select — isti stil kao input */
.region-slot select { width: 100%; padding: 13px 16px; font-size: 14px; font-family: var(--font-body); color: var(--text-dark); background: var(--mist); border: none; border-radius: var(--radius-sm); cursor: pointer; }
.region-slot select:focus { outline: none; background: var(--bg-white); box-shadow: 0 0 0 3px rgba(241, 255, 98, 0.8), var(--shadow-sm); }

/* ============================================================ USPJEŠNA REGISTRACIJA */
.reg-success { display: flex; flex-direction: column; align-items: flex-start; gap: 18px; }
.reg-success-icon { font-size: 52px; color: var(--success); line-height: 1; }
.reg-success h1 { margin: 0; }
.reg-success-lead { font-size: 16px; color: var(--text-muted); line-height: 1.6; margin: 0; }
.reg-success-steps { display: flex; flex-direction: column; gap: 12px; width: 100%; margin: 6px 0; }
.reg-success-step { display: flex; gap: 14px; align-items: flex-start; padding: 16px 18px; background: var(--mist); border-radius: var(--radius); }
.reg-step-icon { flex-shrink: 0; width: 42px; height: 42px; display: flex; align-items: center; justify-content: center; font-size: 17px; color: var(--navy); background: var(--ice); border-radius: 13px; }
.reg-success-step strong { display: block; font-family: var(--font-display); font-size: 15px; color: var(--text-dark); margin-bottom: 4px; }
.reg-success-step p { margin: 0; font-size: 14px; color: var(--text-muted); line-height: 1.55; }
.reg-email { font-weight: 600; color: var(--navy); word-break: break-all; }
.reg-success-note { font-size: 13px; color: #92400e; line-height: 1.55; margin: 0; padding: 13px 15px; background: #FFF9E8; border-radius: var(--radius); }
.reg-success-btn { margin-top: 4px; }

/* ============================================================ RESPONSIVE (mobilno pregledno) */
@media (max-width: 900px) {
    .auth-container { grid-template-columns: 1fr; }
    .auth-left { padding: 26px 22px 30px; min-height: 0; }
    .auth-left-content { margin: 18px 0 4px; max-width: 100%; }
    .auth-left-content h2 { font-size: 25px; }
    .auth-left-content p { font-size: 14.5px; margin-bottom: 14px; }
    .auth-benefits li { font-size: 14px; padding: 5px 0; }
    .auth-logo .logo-img { width: 160px; }
    .auth-right { padding: 26px 16px 40px; }
    .auth-form-wrapper { padding: 28px 22px; border-radius: 20px; }
    .form-row { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
    .auth-left { padding: 20px 16px 24px; }
    .auth-left-content h2 { font-size: 22px; }
    .auth-form-wrapper { padding: 24px 16px; }
    .auth-form-wrapper h1 { font-size: 23px; }
    .auth-subtitle { font-size: 13.5px; }
    .account-type-toggle { flex-direction: column; gap: 8px; }
    .btn-lg { padding: 15px 22px; font-size: 14px; }
    .phone-input-group { grid-template-columns: 116px 1fr; }
    .phone-input-group .ss-panel { min-width: 0; width: calc(100vw - 64px); }
    .reg-success-icon { font-size: 44px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
