/* ═══════════════════════════════════════════
   AKIYA CRM — Login Page · Claude Theme
   Light:  Cream #FAF9F7 · Coral #D97757 · Slate #1F1F1F
   Dark:   #121212 · #1E1E1E · Coral #E08A6B
═══════════════════════════════════════════ */
@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;0,9..40,600;1,9..40,400&display=swap');

/* ── CSS VARIABLES ── */
:root {
    --cream:        #FAF9F7;
    --cream-2:      #F3F0EB;
    --cream-3:      #EAE7E0;
    --coral:        #D97757;
    --coral-hover:  #C86445;
    --coral-glow:   rgba(217, 119, 87, 0.25);
    --slate:        #1F1F1F;
    --stone:        #5F5F5F;
    --stone-light:  #9B9490;
    --border:       rgba(0, 0, 0, 0.06);
    --border-solid: #E0DDD7;
    --white:        #FFFFFF;

    /* Semantic aliases */
    --bg:           var(--cream);
    --surface:      var(--white);
    --text:         var(--slate);
    --text-muted:   var(--stone);
    --accent:       var(--coral);
    --accent-hover: var(--coral-hover);

    --error-bg:     rgba(239, 68, 68, 0.08);
    --error-text:   #c0392b;
    --error-border: rgba(239, 68, 68, 0.35);
    --success-bg:   rgba(16, 185, 129, 0.08);
    --success-text: #0d6e4f;
    --success-border: rgba(16, 185, 129, 0.35);
    --warning-bg:   rgba(245, 158, 11, 0.08);
    --warning-text: #92400e;
    --warning-border: rgba(245, 158, 11, 0.35);

    --shadow-sm:    0 2px 8px rgba(0, 0, 0, 0.06);
    --shadow-md:    0 8px 24px rgba(0, 0, 0, 0.09);
    --shadow-lg:    0 20px 56px rgba(0, 0, 0, 0.12);
    --shadow-coral: 0 8px 24px rgba(217, 119, 87, 0.3);
}

/* ── DARK MODE VARIABLES ── */
body.dark-mode {
    --bg:           #121212;
    --surface:      #1E1E1E;
    --cream-2:      #232323;
    --cream-3:      #2A2A2A;
    --text:         #F5F5F5;
    --text-muted:   #B0B0B0;
    --border:       rgba(255, 255, 255, 0.08);
    --border-solid: rgba(255, 255, 255, 0.1);
    --accent:       #E08A6B;
    --accent-hover: #D07558;
    --coral-glow:   rgba(224, 138, 107, 0.2);
    --white:        #1E1E1E;

    --error-bg:     rgba(239, 68, 68, 0.12);
    --error-text:   #fca5a5;
    --error-border: rgba(239, 68, 68, 0.3);
    --success-bg:   rgba(16, 185, 129, 0.12);
    --success-text: #6ee7b7;
    --success-border: rgba(16, 185, 129, 0.3);
    --warning-bg:   rgba(245, 158, 11, 0.12);
    --warning-text: #fcd34d;
    --warning-border: rgba(245, 158, 11, 0.3);

    --shadow-sm:    0 2px 8px rgba(0, 0, 0, 0.4);
    --shadow-md:    0 8px 24px rgba(0, 0, 0, 0.5);
    --shadow-lg:    0 20px 56px rgba(0, 0, 0, 0.6);
    --shadow-coral: 0 8px 24px rgba(224, 138, 107, 0.25);
}

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

/* ── BODY ── */
body {
    font-family: 'DM Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    transition: background 0.3s ease, color 0.3s ease;
    position: relative;
    overflow-x: hidden;
}

/* Subtle radial glow in background */
body::before {
    content: '';
    position: fixed;
    top: -30%;
    right: -20%;
    width: 600px;
    height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(217, 119, 87, 0.08) 0%, transparent 65%);
    pointer-events: none;
    z-index: 0;
}
body::after {
    content: '';
    position: fixed;
    bottom: -20%;
    left: -15%;
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(217, 119, 87, 0.05) 0%, transparent 65%);
    pointer-events: none;
    z-index: 0;
}
body.dark-mode::before {
    background: radial-gradient(circle, rgba(224, 138, 107, 0.07) 0%, transparent 65%);
}
body.dark-mode::after {
    background: radial-gradient(circle, rgba(224, 138, 107, 0.04) 0%, transparent 65%);
}

/* ── THEME TOGGLE ── */
.theme-toggle-btn {
    position: fixed;
    top: 24px;
    right: 24px;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    background: var(--surface);
    border: 1px solid var(--border-solid);
    color: var(--text-muted);
    font-size: 17px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
    transition: all 0.25s ease;
    z-index: 1000;
}
.theme-toggle-btn:hover {
    color: var(--text);
    background: var(--cream-2);
    transform: rotate(15deg);
    box-shadow: var(--shadow-md);
}

/* ── LOGIN CARD ── */
.login-container {
    max-width: 460px;
    width: 100%;
    background: var(--surface);
    border: 1px solid var(--border-solid);
    border-radius: 24px;
    box-shadow: var(--shadow-lg);
    overflow: visible;
    position: relative;
    z-index: 1;
    animation: cardSlideUp 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes cardSlideUp {
    from { opacity: 0; transform: translateY(28px); }
    to   { opacity: 1; transform: translateY(0); }
}

.left-section {
    padding: 48px 44px 44px;
    display: flex;
    flex-direction: column;
}

/* ── LOGO ── */
.login-icon-container {
    display: flex;
    justify-content: center;
    margin-bottom: 28px;
}

.login-icon-container .brand-logo-wrap {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: var(--cream-2);
    border: 2px solid var(--border-solid);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    animation: logoBob 4s ease-in-out infinite;
    box-shadow: 0 4px 20px var(--coral-glow);
}

.login-icon-container .brand-logo-wrap::before {
    content: '';
    position: absolute;
    inset: -3px;
    border-radius: 50%;
    background: conic-gradient(
        var(--accent) 0deg,
        transparent 120deg,
        var(--accent) 240deg,
        transparent 360deg
    );
    opacity: 0.35;
    animation: logoSpin 6s linear infinite;
    z-index: 0;
}

.login-logo {
    width: 72px;
    height: 72px;
    border-radius: 50%;
    object-fit: cover;
    position: relative;
    z-index: 1;
    display: block;
}

@keyframes logoBob {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-7px); }
}
@keyframes logoSpin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* ── HEADINGS ── */
.form-title {
    font-family: 'Instrument Serif', Georgia, serif;
    font-size: 2rem;
    font-weight: 400;
    color: var(--text);
    text-align: center;
    letter-spacing: -0.02em;
    margin-bottom: 6px;
    line-height: 1.2;
}

.form-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    text-align: center;
    margin-bottom: 32px;
    line-height: 1.5;
}

/* ── ALERTS ── */
.alert {
    padding: 13px 16px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: 0.875rem;
    border: 1px solid;
    display: flex;
    align-items: center;
    gap: 9px;
    animation: alertSlide 0.35s ease;
    line-height: 1.45;
}

@keyframes alertSlide {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.alert::before {
    font-family: 'Bootstrap Icons';
    font-size: 16px;
    flex-shrink: 0;
}

.alert-error {
    background: var(--error-bg);
    color: var(--error-text);
    border-color: var(--error-border);
}
.alert-error::before { content: '\f33a'; }

.alert-success {
    background: var(--success-bg);
    color: var(--success-text);
    border-color: var(--success-border);
}
.alert-success::before { content: '\f26b'; }

.alert-warning {
    background: var(--warning-bg);
    color: var(--warning-text);
    border-color: var(--warning-border);
}
.alert-warning::before { content: '\f33b'; }

/* ── FORM GROUPS ── */
.form-group { margin-bottom: 20px; }

label {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 8px;
    color: var(--text);
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.01em;
}

label i {
    color: var(--accent);
    font-size: 15px;
}

/* ── INPUTS ── */
input {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--border-solid);
    border-radius: 10px;
    font-size: 0.95rem;
    font-family: 'DM Sans', sans-serif;
    background: var(--cream-2);
    color: var(--text);
    transition: all 0.2s ease;
    outline: none;
}

input::placeholder { color: var(--stone-light); }

input:focus {
    border-color: var(--accent);
    background: var(--surface);
    box-shadow: 0 0 0 3px var(--coral-glow);
}

.input-error {
    border-color: var(--error-border) !important;
    background: var(--error-bg) !important;
}

/* ── PASSWORD WRAPPER ── */
.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper input { padding-right: 48px; }

.password-toggle {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    color: var(--stone-light);
    cursor: pointer;
    padding: 7px;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}
.password-toggle:hover {
    color: var(--accent);
    background: var(--coral-glow);
}
.password-toggle i { font-size: 17px; }

/* ── INLINE ERRORS ── */
.error {
    color: var(--error-text);
    font-size: 0.8rem;
    margin-top: 6px;
    display: flex;
    align-items: center;
    gap: 5px;
}
.error::before {
    content: '\f33a';
    font-family: 'Bootstrap Icons';
    font-size: 12px;
}

/* ── PRIMARY BUTTON ── */
.btn {
    width: 100%;
    padding: 14px 22px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: 'DM Sans', sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    margin-top: 8px;
    transition: all 0.25s ease;
    box-shadow: 0 4px 14px var(--coral-glow);
    position: relative;
    overflow: hidden;
}

.btn::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.18), transparent);
    transition: left 0.45s ease;
}
.btn:hover::before { left: 100%; }

.btn:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 22px var(--coral-glow);
}
.btn:active { transform: translateY(0); }

.btn i {
    font-size: 17px;
    transition: transform 0.25s ease;
}
.btn:hover i { transform: translateX(3px); }

/* ── LINKS SECTION ── */
.links {
    text-align: center;
    margin-top: 28px;
}

.forgot-link {
    color: var(--accent);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 8px;
    transition: all 0.2s ease;
}
.forgot-link:hover {
    background: var(--coral-glow);
    color: var(--accent-hover);
}

/* ── DIVIDER ── */
.divider {
    text-align: center;
    margin: 20px 0;
    position: relative;
    color: var(--stone-light);
    font-size: 0.78rem;
    font-weight: 500;
    letter-spacing: 0.05em;
}
.divider::before,
.divider::after {
    content: '';
    position: absolute;
    top: 50%;
    width: 38%;
    height: 1px;
    background: var(--border-solid);
}
.divider::before { left: 0; }
.divider::after  { right: 0; }
.divider span {
    background: var(--surface);
    padding: 0 14px;
    position: relative;
    z-index: 1;
}

/* ── REGISTRATION DROPDOWN ── */
.registration-dropdown {
    position: relative;
    display: block;
    width: 100%;
    margin-top: 14px;
}

.btn-create-account {
    width: 100%;
    padding: 13px 18px;
    background: transparent;
    color: var(--text);
    border: 1.5px solid var(--border-solid);
    border-radius: 10px;
    font-size: 0.9rem;
    font-weight: 600;
    font-family: 'DM Sans', sans-serif;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    transition: all 0.25s ease;
}
.btn-create-account:hover {
    border-color: var(--accent);
    color: var(--accent);
    background: var(--coral-glow);
    transform: translateY(-1px);
}
.btn-create-account > span {
    display: flex;
    align-items: center;
    gap: 8px;
}
.btn-create-account i { font-size: 17px; }

.icon-chevron { transition: transform 0.3s ease; }
.registration-menu.active + .btn-create-account .icon-chevron,
.btn-create-account[aria-expanded="true"] .icon-chevron { transform: rotate(180deg); }

/* Registration Menu */
.registration-menu {
    position: absolute;
    bottom: calc(100% + 8px);
    left: 0; right: 0;
    background: var(--surface);
    border: 1px solid var(--border-solid);
    border-radius: 14px;
    box-shadow: var(--shadow-lg);
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition: all 0.25s ease;
    z-index: 1000;
    overflow: hidden;
}
.registration-menu.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.registration-option {
    display: flex;
    align-items: center;
    padding: 15px 16px;
    text-decoration: none;
    color: var(--text);
    transition: all 0.2s ease;
    border-bottom: 1px solid var(--border);
    position: relative;
    overflow: hidden;
}
.registration-option:last-child { border-bottom: none; }

.registration-option::before {
    content: '';
    position: absolute;
    left: 0; top: 0;
    height: 100%; width: 3px;
    background: var(--accent);
    transform: scaleY(0);
    transition: transform 0.25s ease;
}
.registration-option:hover::before { transform: scaleY(1); }
.registration-option:hover {
    background: var(--cream-2);
    padding-left: 20px;
}

.option-icon {
    width: 44px; height: 44px;
    border-radius: 11px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
    margin-right: 13px;
    flex-shrink: 0;
    transition: transform 0.25s ease;
}
.individual-icon {
    background: rgba(217, 119, 87, 0.12);
    color: var(--accent);
}
.company-icon {
    background: rgba(79, 138, 212, 0.12);
    color: #4F8AD4;
}
body.dark-mode .individual-icon {
    background: rgba(224, 138, 107, 0.15);
    color: var(--accent);
}
body.dark-mode .company-icon {
    background: rgba(107, 163, 232, 0.15);
    color: #6BA3E8;
}
.registration-option:hover .option-icon { transform: scale(1.08) rotate(4deg); }

.option-content { flex: 1; min-width: 0; }
.option-title {
    font-weight: 600;
    color: var(--text);
    margin-bottom: 3px;
    font-size: 0.9rem;
}
.option-subtitle {
    font-size: 0.78rem;
    color: var(--text-muted);
}

.icon-arrow {
    font-size: 16px;
    color: var(--accent);
    margin-left: 10px;
    flex-shrink: 0;
    transition: transform 0.2s ease;
}
.registration-option:hover .icon-arrow { transform: translateX(3px); }

/* ── MODAL STYLES ── */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 9999;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.25s ease;
}
.modal-overlay.active { display: flex; }

@keyframes fadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.modal-container {
    background: var(--surface);
    border: 1px solid var(--border-solid);
    border-radius: 20px;
    max-width: 500px;
    width: 92%;
    max-height: 92vh;
    overflow-y: auto;
    box-shadow: var(--shadow-lg);
    animation: modalSlideUp 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes modalSlideUp {
    from { opacity: 0; transform: translateY(40px); }
    to   { opacity: 1; transform: translateY(0); }
}

.modal-header {
    padding: 22px 28px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: var(--accent);
    border-radius: 20px 20px 0 0;
}
.modal-header h3 {
    margin: 0;
    color: #fff;
    font-family: 'Instrument Serif', serif;
    font-size: 1.4rem;
    font-weight: 400;
    display: flex;
    align-items: center;
    gap: 10px;
}
.modal-close {
    background: rgba(255,255,255,0.18);
    border: 1.5px solid rgba(255,255,255,0.3);
    width: 34px; height: 34px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #fff;
    font-size: 16px;
    transition: all 0.25s ease;
}
.modal-close:hover {
    background: rgba(255,255,255,0.3);
    transform: rotate(90deg);
}

.modal-body { padding: 28px; }

.modal-subtitle {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 22px;
    font-size: 0.875rem;
    line-height: 1.6;
}

.helper-text {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-top: 5px;
}

/* Modal error (no pseudo-element) */
.modal-body .error::before { content: none !important; display: none !important; }

/* Telegram info box */
.telegram-info {
    background: var(--cream-2);
    border: 1px solid var(--border-solid);
    padding: 18px;
    border-radius: 12px;
    margin-bottom: 22px;
    text-align: center;
}
.telegram-username {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--accent);
    margin-bottom: 8px;
}
.bot-link {
    display: inline-block;
    background: var(--accent);
    color: #fff;
    padding: 9px 18px;
    border-radius: 8px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    margin: 12px 0 8px;
    transition: all 0.25s ease;
}
.bot-link:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: var(--shadow-coral);
    color: #fff;
}

/* Modal alerts */
.modal-alert {
    padding: 13px 16px;
    border-radius: 10px;
    margin-bottom: 18px;
    font-size: 0.875rem;
    animation: alertSlide 0.3s ease;
}
.modal-alert.success {
    background: var(--success-bg);
    color: var(--success-text);
    border: 1px solid var(--success-border);
}
.modal-alert.error {
    background: var(--error-bg);
    color: var(--error-text);
    border: 1px solid var(--error-border);
}
.modal-alert.info {
    background: rgba(79, 138, 212, 0.08);
    color: #2563eb;
    border: 1px solid rgba(79, 138, 212, 0.25);
}
body.dark-mode .modal-alert.info {
    color: #93c5fd;
    background: rgba(79, 138, 212, 0.12);
    border-color: rgba(79, 138, 212, 0.3);
}

/* ── RESPONSIVE ── */
@media (max-width: 520px) {
    body { padding: 16px; }

    .left-section { padding: 36px 28px 32px; }

    .form-title { font-size: 1.7rem; }

    .login-icon-container .brand-logo-wrap { width: 68px; height: 68px; }
    .login-logo { width: 62px; height: 62px; }

    .theme-toggle-btn { top: 16px; right: 16px; width: 38px; height: 38px; font-size: 15px; }

    .modal-container { width: 96%; max-height: 96vh; }
    .modal-header { padding: 18px 20px; }
    .modal-body { padding: 20px; }
}
