/* =========================================
 *   app.css — Клиентская часть (mobile-first)
 *   Аудионика — Личный кабинет
 * ========================================= */

/* --- Reset & Base --- */
*,*::before,*::after{box-sizing:border-box;margin:0;padding:0}
html{font-size:16px;-webkit-tap-highlight-color:transparent}
body{
  font-family:-apple-system,BlinkMacSystemFont,'Segoe UI',Roboto,'Helvetica Neue',Arial,sans-serif;
  background:#f2f2f7;color:#1c1c1e;line-height:1.4;
  -webkit-font-smoothing:antialiased
}
a{color:#007aff;text-decoration:none}

/* --- Auth screens --- */
.auth-body{background:#fff;min-height:100vh;display:flex;align-items:center;justify-content:center}
.auth-screen{width:100%;max-width:400px;padding:40px 24px 32px}
.auth-logo{font-size:2.8rem;text-align:center;margin-bottom:8px}
.auth-title{font-size:1.6rem;font-weight:800;text-align:center;margin-bottom:4px}
.auth-sub{font-size:0.9rem;color:#8e8e93;text-align:center;margin-bottom:32px}
.auth-form label{font-size:0.82rem;font-weight:600;color:#555;margin-bottom:6px;display:block}
.auth-hint{text-align:center;margin-top:16px;font-size:0.78rem;color:#8e8e93}

/* --- Inputs --- */
.input{width:100%;padding:14px 16px;border:2px solid #e8e8ed;border-radius:12px;font-size:1rem;margin-bottom:16px;background:#f9f9f9;outline:none;transition:border-color .2s}
.input:focus{border-color:#007aff;background:#fff}
.input--code{text-align:center;font-size:1.5rem;letter-spacing:8px}
.input--phone{font-size:1.1rem}

/* --- Alerts --- */
.alert{padding:12px 14px;border-radius:10px;font-size:0.85rem;margin-bottom:14px;font-weight:500}
.alert--error{background:#ffebee;color:#c62828;border:1px solid #ffcdd2}

/* --- Buttons --- */
.btn{display:inline-flex;align-items:center;justify-content:center;gap:6px;padding:12px 20px;border-radius:12px;font-size:0.95rem;font-weight:600;border:none;cursor:pointer;width:100%;transition:opacity .15s;text-decoration:none;text-align:center}
.btn:active{opacity:0.8}
.btn--primary{background:#007aff;color:#fff}
.btn--outline{background:transparent;color:#007aff;border:2px solid #007aff}
.btn--danger{background:#ff3b30;color:#fff}
.btn--lg{padding:14px 20px;font-size:1.05rem}
.btn--sm{padding:8px 14px;font-size:0.82rem;width:auto;border-radius:8px}

/* --- Header --- */
.header{background:linear-gradient(135deg,#007aff,#0056d6);color:#fff;padding:16px 16px 12px;position:sticky;top:0;z-index:10;box-shadow:0 2px 12px rgba(0,0,0,0.15)}
.header__top{display:flex;align-items:center;justify-content:space-between}
.header__title{font-size:1.2rem;font-weight:700}
.header__user{display:flex;align-items:center;gap:8px}
.header__avatar{width:36px;height:36px;border-radius:50%;background:rgba(255,255,255,0.25);display:flex;align-items:center;justify-content:center;font-weight:600;font-size:.9rem;border:2px solid rgba(255,255,255,0.4)}
.header__status{font-size:0.7rem;background:rgba(255,255,255,0.2);padding:2px 8px;border-radius:10px;margin-top:2px;display:inline-block}

/* --- Container --- */
.container{max-width:480px;margin:0 auto;padding:12px 12px 24px}

/* --- Quick Actions --- */
.quick-actions{display:grid;grid-template-columns:repeat(4,1fr);gap:8px;margin-bottom:14px}
.quick-action{background:#fff;border-radius:14px;padding:12px 6px;text-align:center;box-shadow:0 1px 4px rgba(0,0,0,0.05);cursor:pointer;transition:transform .15s;display:block;color:#1c1c1e!important;text-decoration:none}
.quick-action:active{transform:scale(0.95)}
.quick-action__icon{font-size:1.6rem;margin-bottom:4px;display:block}
.quick-action__label{font-size:0.65rem;color:#555;font-weight:500;line-height:1.2}

/* --- Cards --- */
.card{background:#fff;border-radius:14px;padding:14px 16px;box-shadow:0 1px 4px rgba(0,0,0,0.05);margin-bottom:10px}
.card--warning{border-left:4px solid #ff9500}
.card--danger{border-left:4px solid #ff3b30}
.card--success{border-left:4px solid #34c759}
.card__header{display:flex;justify-content:space-between;align-items:flex-start;margin-bottom:6px}
.card__header h3{font-size:0.95rem;font-weight:600}
.card__text{font-size:0.85rem;color:#555;line-height:1.5}
.card__row{display:flex;justify-content:space-between;padding:6px 0;font-size:0.88rem;border-bottom:1px solid #f0f0f0}
.card__row:last-child{border-bottom:none}
.card__row-label{color:#888}
.card__row-value{font-weight:500;color:#1c1c1e}

/* --- Badges --- */
.badge{font-size:0.68rem;padding:2px 10px;border-radius:10px;font-weight:600;white-space:nowrap}
.badge--green{background:#e8f5e9;color:#2e7d32}
.badge--orange{background:#fff3e0;color:#e65100}
.badge--red{background:#ffebee;color:#c62828}
.badge--blue{background:#e3f2fd;color:#1565c0}

/* --- Notifications --- */
.notif{display:flex;gap:10px;padding:10px 0;border-bottom:1px solid #f0f0f0}
.notif:last-child{border-bottom:none}
.notif__icon{font-size:1.2rem;width:24px;text-align:center;flex-shrink:0}
.notif__text{flex:1;font-size:0.85rem}
.notif__date{font-size:0.7rem;color:#8e8e93;white-space:nowrap}

/* --- Menu Items --- */
.menu-item{display:flex;align-items:center;gap:12px;padding:12px 0;border-bottom:1px solid #f0f0f0;cursor:pointer;color:#1c1c1e!important;text-decoration:none}
.menu-item:last-child{border-bottom:none}
.menu-item__icon{font-size:1.3rem;width:28px;text-align:center}
.menu-item__content{flex:1}
.menu-item__title{font-size:0.92rem;font-weight:600}
.menu-item__sub{font-size:0.75rem;color:#8e8e93;margin-top:1px}
.menu-item__chevron{color:#c7c7cc;font-size:1.1rem}

/* --- Bonus --- */
.bonus-header{background:linear-gradient(135deg,#ff9500,#ff6b00);border-radius:14px;padding:18px;color:#fff;margin-bottom:12px;text-align:center}
.bonus-header__amount{font-size:2.5rem;font-weight:800;letter-spacing:-1px}
.bonus-header__label{font-size:0.85rem;opacity:.85;margin-bottom:2px}
.bonus-header__expire{font-size:0.72rem;opacity:.7;margin-top:4px}

/* --- Tab bar --- */
.tab-bar{position:fixed;bottom:0;left:0;right:0;background:#fff;display:flex;justify-content:space-around;padding:6px 0 max(env(safe-area-inset-bottom), 20px);box-shadow:0 -1px 8px rgba(0,0,0,0.08);z-index:100}
.tab-bar__item{text-align:center;font-size:0.6rem;color:#8e8e93;cursor:pointer;flex:1;text-decoration:none;display:block}
.tab-bar__item--active{color:#007aff}
.tab-bar__item-icon{font-size:1.35rem;display:block;margin-bottom:1px}

/* --- Grid --- */
.grid-2{display:grid;grid-template-columns:1fr 1fr;gap:10px}

/* --- Section title --- */
.section__title{font-size:1rem;font-weight:700;color:#1c1c1e;margin-bottom:10px;padding:0 4px;display:flex;align-items:center;gap:8px}

/* --- pb-safe --- */
.pb-safe{padding-bottom:72px}

/* --- Device card --- */
.device-card{display:flex;gap:12px;align-items:flex-start;padding:12px 0;border-bottom:1px solid #f0f0f0}
.device-card:last-child{border-bottom:none}
.device-card__icon{width:44px;height:44px;border-radius:12px;background:#e8f0fe;display:flex;align-items:center;justify-content:center;font-size:1.4rem;flex-shrink:0}
.device-card__info{flex:1}
.device-card__model{font-size:0.9rem;font-weight:600}
.device-card__sn{font-size:0.72rem;color:#8e8e93}

/* --- Timeline --- */
.timeline{position:relative;padding-left:20px}
.timeline::before{content:'';position:absolute;left:7px;top:4px;bottom:4px;width:2px;background:#e0e0e0}
.timeline__item{position:relative;padding-bottom:14px}
.timeline__item::before{content:'';position:absolute;left:-16px;top:6px;width:10px;height:10px;border-radius:50%;background:#007aff;border:2px solid #fff;box-shadow:0 0 0 2px #007aff}
.timeline__item--done::before{background:#34c759;box-shadow:0 0 0 2px #34c759}
.timeline__item--current::before{background:#ff9500;box-shadow:0 0 0 2px #ff9500}
.timeline__date{font-size:0.72rem;color:#8e8e93}
.timeline__text{font-size:0.88rem;font-weight:500}

/* --- Calendar row --- */
.calendar-row{display:flex;gap:6px;overflow-x:auto;padding:2px 0 8px;-webkit-overflow-scrolling:touch}
.calendar-row::-webkit-scrollbar{display:none}
.cal-day{flex-shrink:0;width:48px;text-align:center;padding:8px 0;border-radius:12px;background:#fff;border:1px solid #e8e8ed}
.cal-day--active{background:#007aff;color:#fff;border-color:#007aff}
.cal-day__dow{font-size:0.62rem;color:#8e8e93}
.cal-day--active .cal-day__dow{color:rgba(255,255,255,0.7)}
.cal-day__num{font-size:1rem;font-weight:700}

/* --- Calendar scroll wrapper --- */
.scroll-x{overflow-x:auto;-webkit-overflow-scrolling:touch}
.scroll-x::-webkit-scrollbar{display:none}

/* --- Product card --- */
.product-card{background:#fff;border-radius:14px;overflow:hidden;box-shadow:0 1px 4px rgba(0,0,0,0.05)}
.product-card__img{background:#f5f5f5;height:100px;display:flex;align-items:center;justify-content:center;font-size:2rem;color:#aaa}
.product-card__body{padding:8px 10px 10px}
.product-card__name{font-size:0.78rem;font-weight:600;margin-bottom:2px;line-height:1.2}
.product-card__price{font-size:0.9rem;font-weight:700;color:#007aff}

/* --- Test prompt --- */
.test-prompt{background:linear-gradient(135deg,#5856d6,#7c3aed);border-radius:14px;padding:18px;color:#fff;text-align:center}
.test-prompt__title{font-size:1.05rem;font-weight:700;margin-bottom:4px}
.test-prompt__text{font-size:0.8rem;opacity:.85;margin-bottom:12px}

/* --- Chat preview --- */
.chat-preview{display:flex;gap:10px;align-items:center;padding:10px 0;color:#fff!important}
.chat-preview__avatar{width:40px;height:40px;border-radius:50%;background:#e8f0fe;display:flex;align-items:center;justify-content:center;font-size:1.1rem}
.chat-preview__info{flex:1}
.chat-preview__name{font-size:0.9rem;font-weight:600}
.chat-preview__msg{font-size:0.78rem;color:#8e8e93;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.chat-preview__time{font-size:0.68rem;color:#c7c7cc}

/* --- Service tag --- */
.service-tag{background:#e8f0fe;border-radius:10px;padding:10px;text-align:center;font-size:0.8rem;font-weight:600;cursor:pointer;transition:all .15s}
.service-tag--active{background:#007aff;color:#fff}
.service-tag--inactive{background:#f5f5f5;color:#888}
