/* ================================
   MOTORICA — Корпоративный портал кандидата (Clean White Theme)
   ================================ */
:root {
    --m-pine:   #004739;
    --m-dark:   #002d25;
    --m-green:  #01b87b;
    --m-bright: #1ee184;
    --m-glow:   rgba(1, 184, 123, 0.25);
    --bg-page:  #f4f9f7;
    --bg-card:  #ffffff;
    --border:   rgba(1, 184, 123, 0.2);
    --text:     #111827;
    --text-sub: #4b5563;
    --text-dim: #9ca3af;
}

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

html, body {
    height: 100%;
    font-family: 'Inter', sans-serif;
    background: var(--bg-page);
    color: var(--text);
    position: relative;
    overflow-x: hidden;
    scrollbar-width: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
    display: none;
}

/* Декоративные градиенты на фоне (светлые) */
.bg-shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    z-index: 0;
    pointer-events: none;
}
.bg-shape-1 {
    width: 600px; height: 600px;
    background: rgba(1, 184, 123, 0.1);
    top: -150px; right: -150px;
    animation: float 15s ease-in-out infinite;
}
.bg-shape-2 {
    width: 400px; height: 400px;
    background: rgba(30, 225, 132, 0.08);
    bottom: -100px; left: -100px;
    animation: float 20s ease-in-out infinite reverse;
}

@keyframes float {
    0%, 100% { transform: translate(0, 0); }
    50% { transform: translate(-30px, 20px); }
}

/* ---- Центрированный контейнер ---- */
.auth-container {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    width: 100%;
    max-width: 500px;
    margin: 0 auto;
}

/* ---- Логотип ---- */
.logo-wrapper {
    margin-bottom: 24px;
    animation: fadeDown 0.6s ease-out;
}
.main-logo {
    width: 100px;
    height: auto;
    object-fit: contain;
}

/* ---- Заголовок ---- */
.auth-header {
    text-align: center;
    margin-bottom: 32px;
    animation: fadeDown 0.7s ease-out;
}

.auth-title {
    font-size: 28px;
    font-weight: 800;
    color: var(--m-pine);
    margin-bottom: 10px;
    letter-spacing: -0.5px;
}

.auth-subtitle {
    font-size: 14px;
    color: var(--text-sub);
    line-height: 1.5;
    max-width: 380px;
    margin: 0 auto;
}

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

/* ---- Карточка ---- */
.auth-card {
    width: 100%;
    background: var(--bg-card);
    border-radius: 24px;
    box-shadow: 0 10px 40px rgba(0, 71, 57, 0.06);
    border: 1px solid rgba(1, 184, 123, 0.1);
    padding: 40px;
    animation: scaleUp 0.5s ease-out;
}

@keyframes scaleUp {
    from { opacity: 0; transform: scale(0.95); }
    to { opacity: 1; transform: scale(1); }
}

.form-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--m-pine);
    text-align: center;
}

.form-desc {
    font-size: 13px;
    color: var(--text-sub);
    text-align: center;
    margin-bottom: 30px;
}

/* ---- Шаги ---- */
.step-indicator {
    display: flex;
    gap: 8px;
    margin-bottom: 30px;
}

.step-dot {
    height: 4px;
    border-radius: 2px;
    background: #e5e7eb;
    transition: all 0.4s ease;
    flex: 1;
}
.step-dot--active {
    background: var(--m-green);
    box-shadow: 0 0 8px var(--m-glow);
}
.step-dot--done {
    background: var(--m-pine);
}

/* ---- Ошибка ---- */
.error-plate {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 12px;
    color: #ef4444;
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: shake 0.4s ease-in-out;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* ---- Поля ввода ---- */
.input-group {
    margin-bottom: 24px;
}

.input-label {
    display: block;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-sub);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.modern-input {
    width: 100%;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 14px 16px;
    color: var(--text);
    font-size: 16px;
    font-family: 'Inter', sans-serif;
    outline: none;
    transition: all 0.25s ease;
    box-shadow: inset 0 1px 2px rgba(0,0,0,0.02);
}

.modern-input:focus {
    border-color: var(--m-green);
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(1, 184, 123, 0.15);
}

.modern-input::placeholder { color: var(--text-dim); }

.sms-input {
    text-align: center;
    letter-spacing: 12px;
    font-size: 26px;
    font-weight: 800;
    color: var(--m-pine);
    padding: 16px;
}

/* ---- Кнопка ---- */
.btn-submit {
    width: 100%;
    background: var(--m-pine);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 15px;
    font-size: 15px;
    font-weight: 600;
    font-family: 'Inter', sans-serif;
    cursor: pointer;
    transition: all 0.25s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.btn-submit:hover {
    background: var(--m-green);
    box-shadow: 0 6px 20px var(--m-glow);
    transform: translateY(-2px);
}
.btn-submit:active { transform: translateY(0); }

.ms-2 { margin-left: 8px; }
.me-1 { margin-right: 6px; }

/* ---- Ссылка назад ---- */
.back-action {
    text-align: center;
    margin-top: 24px;
}
.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-dim);
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    transition: 0.25s;
}
.back-link:hover { color: var(--m-pine); }

/* ---- Подвал ---- */
.auth-footer {
    margin-top: 24px;
    font-size: 12px;
    color: var(--text-dim);
    text-align: center;
}

@media (max-width: 480px) {
    .auth-card { padding: 30px 24px; }
    .auth-title { font-size: 24px; }
    .main-logo { width: 80px; }
}

/* Класс выставляется по реальному экрану устройства, поэтому работает и когда
   внешний iframe на motorica.org получил десктопную ширину. */
html.candidate-mobile .auth-container {
    width: 100%;
    max-width: none;
    min-height: 100dvh;
    padding: 24px 16px;
}

html.candidate-mobile-embedded .auth-container {
    min-height: var(--candidate-mobile-height, 100vh);
}

html.candidate-mobile .logo-wrapper { margin-bottom: 16px; }
html.candidate-mobile .main-logo { width: 76px; }
html.candidate-mobile .auth-header { margin-bottom: 22px; }
html.candidate-mobile .auth-title { font-size: 24px; line-height: 1.15; }
html.candidate-mobile .auth-subtitle { max-width: 330px; font-size: 14px; }
html.candidate-mobile .auth-card { max-width: 390px; padding: 26px 20px; border-radius: 20px; }
html.candidate-mobile .form-title { font-size: 19px; }
html.candidate-mobile .form-desc { margin-bottom: 22px; font-size: 13px; line-height: 1.45; }
html.candidate-mobile .step-indicator { margin-bottom: 22px; }
html.candidate-mobile .modern-input { min-height: 50px; font-size: 16px; }
html.candidate-mobile .btn-submit { min-height: 50px; font-size: 15px; }
html.candidate-mobile .auth-footer { margin-top: 18px; }
