:root {
    --safe-top: env(safe-area-inset-top, 20px);
    --text-wight: #fff;
    --primary: #007AFF;
    --primary-hover: #0056b3;
    --success: #34C759;
    --error: #FF3B30;
    --bg-gradient: #000000 /* linear-gradient(135deg, #f2f2f7 0%, #e5e5ea 100%)*/;
    --text: #1c1c1e;
    --text-muted: #8e8e93;
    --auth-bg: linear-gradient(170deg, #000 10%, #627bff 100%);
    
    /* Стекло и тени */
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.4);
    --card-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.07);
    
    /* Константы iOS 26 */
    --radius-card: 32px; /* Более органическое скругление */
    --radius-input: 14px;
    --padding-main: 24px;
}

* { 
    box-sizing: border-box; 
    -webkit-tap-highlight-color: transparent;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue", sans-serif;
}

html, body {
  /* Запрещает обновление страницы потянув вниз и лишний скролл */
  overscroll-behavior-y: none;
  /* Для верности фиксируем высоту */
  min-height: 100vh;
  overflow: hidden; 
  background-color: #000000;
}

body {
    padding-top: var(--safe-top);
    padding-left: 20px;
    padding-right: 20px;
    padding-bottom: 20px;
    background: var(--auth-bg) !important;
    color: var(--text);
    display: flex;
    justify-content: center;
    min-height: 100vh;
    margin: 0;
    will-change: transform; /* Оптимизация для анимаций */
}

.auth-header-text {
    color: var(--text-wight);
    position: absolute;
    top: calc(90px + var(--safe-top));
    left: 50%;
    font-size: calc(5rem + 3vw);
    transform: translateX(-50%);
    font-family: "Unbounded", sans-serif;
    font-weight: 700;
    z-index: 2;
    height: 78px;
    line-height: 0.6;
    margin: 0;
}

.auth-bg-img {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    height: 100%;
    min-height: 100dvh;
    background: url(/projekts/afina-2026/img/auth-img.png) no-repeat top calc(130px + var(--safe-top)) center fixed;
    background-size: auto 90%;
    z-index: 3;
    pointer-events: none;
    /* Учет системной полоски (Home Indicator) на iPhone */
    padding-bottom: env(safe-area-inset-bottom);
}

.auth-card { 
    width: 100%; 
    max-width: 400px;
    perspective: 1000px;
    z-index: 3;
    position: relative;
}

.card {
    padding: var(--padding-main);
    box-shadow: var(--card-shadow);
    text-align: center;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(180%);
    border-radius: var(--radius-card);
    overflow: hidden;
    border: none;
}

.card::before {
    content: "";
    position: absolute;
    inset: 0; /* Растягиваем на всю площадь */
    border-radius: var(--radius-card);
    padding: 0.8px; /* Это и будет толщина вашего "бордера" */
    
    /* Градиент под углом -30 градусов */
    /* Цвета: белый в углах, прозрачный в центре */
    background: linear-gradient(
        -30deg, 
        rgba(255, 255, 255, 0.8) 0%, 
        rgba(255, 255, 255, 0) 40%, 
        rgba(255, 255, 255, 0) 60%, 
        rgba(255, 255, 255, 0.8) 100%
    );
    
    /* Магия iOS: вырезаем внутреннюю часть, оставляя только padding */
    -webkit-mask: 
        linear-gradient(#fff 0 0) content-box, 
        linear-gradient(#fff 0 0);
    mask: 
        linear-gradient(#fff 0 0) content-box, 
        linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    
    pointer-events: none; /* Чтобы рамка не мешала кликам */
}

h3 {
    margin: 0 0 8px 0;
    font-size: 26px; /* Чуть крупнее по стандартам iOS 26 */
    font-weight: 700;
    letter-spacing: -0.5px;
}

/* Стилизация форм */
.form-group {
    text-align: left;
    margin-bottom: 18px;
}

.form-group label {
    display: block;
    margin-bottom: 6px;
    margin-left: 4px;
    font-size: 13px;
    font-weight: 500;
    color: var(--text-muted);
}

.form-control {
    width: 100%;
    padding: 14px 16px;
    border: 1px solid rgba(0,0,0,0.05);
    border-radius: var(--radius-input);
    font-size: 17px; /* Стандарт Body в iOS */
    background: rgba(255, 255, 255, 0.5);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.form-control:focus {
    background: #fff;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(0, 122, 255, 0.1);
    outline: none;
}

/* Кнопки в стиле Liquid */
.btn {
    width: 100%;
    padding: 16px;
    border: none;
    border-radius: 16px;
    color: white;
    font-weight: 600;
    font-size: 17px;
    cursor: pointer;
    margin-top: 10px;
    transition: transform 0.2s ease, filter 0.2s ease;
    box-shadow: 0 4px 12px rgba(0, 122, 255, 0.2);
    will-change: transform; /* Оптимизация анимации */
}

.btn:active {
    transform: scale(0.96); /* Эффект нажатия iOS */
}

.btn-primary { background: var(--primary); }
.btn-success { background: var(--success); }

/* Анимация переключения (как в нативных приложениях) */
.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
    animation: ios-slide-up 0.4s cubic-bezier(0.23, 1, 0.32, 1);
}

@keyframes ios-slide-up {
    from { opacity: 0; transform: translateY(15px) scale(0.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* Оповещения */
.alert {
    background: rgba(255, 59, 48, 0.1);
    color: var(--error);
    padding: 12px;
    border-radius: 12px;
    margin-bottom: 20px;
    font-size: 14px;
    font-weight: 500;
}

.toggle-link span:first-child {
    color: var(--text-muted);
    cursor: default; /* Текст не кликабельный */
}

.toggle-link span:last-child {
    color: var(--primary);
    cursor: pointer;
    font-weight: 500;
    transition: opacity 0.2s ease;
}

.toggle-link {
    margin-top: 24px;
    font-size: 15px;
}

.toggle-link span {
    font-weight: 600;
}
/*verify*/
        .otp-field { transition: all 0.2s; border: 2px solid #e0e0e0; }
        .otp-field.filled { border-color: var(--primary); background: rgba(67, 97, 238, 0.05); }
        .resend-text { margin-top: 20px; font-size: 14px; color: var(--text-muted); }
        #timer { font-weight: bold; color: var(--primary); }
        .alert-success { background: #e7fbf3; color: var(--success); padding: 10px; border-radius: 8px; margin-bottom: 15px; font-size: 13px; border: 1px solid var(--success); }
/*verify end*/