/* ═══ Auth Pages (Login/Register) ═══ */
.auth-wrapper{display:flex;justify-content:center;align-items:center;min-height:50vh;padding:20px 0}
.auth-card{width:100%;max-width:480px;background:#fff;border-radius:16px;padding:40px;box-shadow:0 4px 24px rgba(0,0,0,.06);border:1px solid var(--border);box-sizing:border-box}
.auth-header{text-align:center;margin-bottom:28px}
.auth-header h1{font-size:26px;font-weight:800;color:var(--text);margin-bottom:6px}
.auth-header p{font-size:14px;color:var(--text2)}
.auth-field{margin-bottom:16px;min-width:0;width:100%}
.auth-field label{display:block;font-size:13px;font-weight:600;color:var(--text);margin-bottom:6px}
.auth-input-wrap{display:flex;align-items:center;gap:10px;border:1.5px solid var(--border);border-radius:10px;padding:0 14px;background:#fafbfc;transition:border-color .2s;width:100%;min-width:0;box-sizing:border-box}
.auth-input-wrap:focus-within{border-color:var(--accent);background:#fff;box-shadow:0 0 0 3px rgba(142,33,42,.08)}
.auth-input-wrap svg{color:var(--text2);flex-shrink:0}
.auth-input-wrap input{flex:1 1 0%;border:none;background:transparent;padding:12px 0;font-size:14px;color:var(--text);outline:none;min-width:0;width:100%;box-sizing:border-box}
.auth-input-wrap input::placeholder{color:#b0b5c0}
.auth-row{display:grid;grid-template-columns:repeat(2, minmax(0, 1fr));gap:14px;width:100%;min-width:0}
.auth-options{display:flex;justify-content:space-between;align-items:center;margin-bottom:20px;font-size:13px}
.auth-remember{display:flex;align-items:center;gap:6px;color:var(--text2);cursor:pointer}
.auth-remember input{accent-color:var(--accent)}
.auth-btn{width:100%;padding:14px;background:var(--accent);color:#fff;border:none;border-radius:10px;font-size:15px;font-weight:700;cursor:pointer;transition:all .2s;letter-spacing:.3px;box-sizing:border-box}
.auth-btn:hover{opacity:.92;transform:translateY(-1px);box-shadow:0 4px 14px rgba(142,33,42,.25)}
.auth-footer{text-align:center;margin-top:22px;font-size:13px;color:var(--text2);padding-top:18px;border-top:1px solid var(--border)}
.auth-footer a{color:var(--accent);font-weight:600;text-decoration:none}
.auth-footer a:hover{text-decoration:underline}
.auth-alert{padding:12px 16px;border-radius:10px;font-size:13px;margin-bottom:18px}
.auth-alert-error{background:rgba(255,77,109,.08);color:#c0392b;border:1px solid rgba(255,77,109,.2)}
.auth-alert-success{background:rgba(0,196,154,.08);color:#0a7c5a;border:1px solid rgba(0,196,154,.2)}

/* ═══ Account Pages ═══ */
.account-layout{display:grid;grid-template-columns:240px 1fr;gap:24px;align-items:start}
.account-sidebar{background:#fff;border-radius:14px;padding:20px;box-shadow:0 2px 12px rgba(0,0,0,.05);border:1px solid var(--border);position:sticky;top:80px}
.account-user{text-align:center;padding-bottom:16px;border-bottom:1px solid var(--border);margin-bottom:12px}
.account-avatar{width:64px;height:64px;border-radius:50%;background:linear-gradient(135deg,var(--accent),#ff6b8a);display:flex;align-items:center;justify-content:center;color:#fff;font-size:24px;font-weight:800;margin:0 auto 10px}
.account-user-name{font-size:15px;font-weight:700;color:var(--text)}
.account-user-email{font-size:12px;color:var(--text2);word-break:break-all}
.account-nav a{display:flex;align-items:center;gap:10px;padding:11px 14px;border-radius:8px;font-size:14px;font-weight:500;color:var(--text);text-decoration:none;transition:all .15s}
.account-nav a:hover,.account-nav a.active{background:rgba(142,33,42,.06);color:var(--accent)}
.account-nav a.active{font-weight:700}
.account-nav a svg{width:18px;height:18px;flex-shrink:0}
.account-content{background:#fff;border-radius:14px;padding:28px;box-shadow:0 2px 12px rgba(0,0,0,.05);border:1px solid var(--border);min-width:0}
.account-content h2{font-size:20px;font-weight:800;margin-bottom:20px;color:var(--text)}
.account-section{margin-bottom:24px;padding-bottom:24px;border-bottom:1px solid var(--border)}
.account-section:last-child{border-bottom:none;margin-bottom:0;padding-bottom:0}
.account-section h3{font-size:15px;font-weight:700;margin-bottom:14px;color:var(--text)}

/* Account stat cards */
.account-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:14px;margin-bottom:24px}
.account-stat{background:var(--bg-alt);border-radius:10px;padding:16px;text-align:center;overflow:hidden}
.account-stat .num{font-size:22px;font-weight:800;color:var(--accent);word-break:break-word}
.account-stat .label{font-size:12px;color:var(--text2);margin-top:4px}

/* Grid helpers for account pages */
.account-grid-2{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.account-grid-3{display:grid;grid-template-columns:1fr 1fr 1fr;gap:14px}
.account-grid-full{grid-column:1/-1}

/* Order rows */
.account-order-row{display:flex;align-items:center;gap:14px;padding:14px;border-radius:10px;border:1px solid var(--border);margin-bottom:10px;transition:background .15s;text-decoration:none;color:inherit}
.account-order-row:hover{background:var(--bg-alt)}
.account-order-id{font-weight:700;font-size:14px;color:var(--accent);min-width:70px}
.account-order-info{flex:1;min-width:0}
.account-order-date{font-size:12px;color:var(--text2)}
.account-order-total{font-weight:700;font-size:14px}

/* Logout button */
.account-logout-form{margin-top:8px}
.account-logout-btn{width:100%;display:flex;align-items:center;gap:10px;padding:11px 14px;border-radius:8px;font-size:14px;font-weight:500;color:var(--error);background:none;border:none;cursor:pointer;transition:all .15s;text-align:left}
.account-logout-btn:hover{background:rgba(255,77,109,.06)}

/* Order detail items */
.od-item{display:flex;align-items:center;gap:12px;padding:12px 0;border-bottom:1px solid var(--border)}
.od-item-img{width:50px;height:50px;border-radius:8px;background:var(--bg-alt);overflow:hidden;flex-shrink:0}
.od-item-img img{width:100%;height:100%;object-fit:cover}
.od-item-info{flex:1;min-width:0}
.od-item-name{font-weight:600;font-size:14px}
.od-item-meta{font-size:12px;color:var(--text2)}
.od-item-price{font-weight:700;font-size:14px;white-space:nowrap}

/* Order totals */
.od-totals{max-width:280px;margin-left:auto;font-size:14px}
.od-total-row{display:flex;justify-content:space-between;padding:8px 0}
.od-total-row.final{border-top:2px solid var(--text);font-weight:800;font-size:16px;padding:10px 0}
.od-total-row.final span:last-child{color:var(--accent)}

/* ═══ Responsive ═══ */
@media(max-width:768px){
    /* Auth */
    .auth-card{padding:24px 18px;border-radius:12px}
    .auth-header h1{font-size:22px}
    .auth-row{grid-template-columns:1fr}

    /* Account layout */
    .account-layout{grid-template-columns:1fr;gap:14px}
    .account-sidebar{position:static;padding:14px;border-radius:12px}
    .account-user{display:flex;align-items:center;gap:12px;text-align:left;padding-bottom:12px;margin-bottom:8px}
    .account-avatar{width:40px;height:40px;font-size:16px;margin:0;flex-shrink:0}
    .account-user-name{font-size:14px}
    .account-user-email{font-size:11px}
    .account-nav{display:flex;gap:4px;overflow-x:auto;padding-bottom:4px;-webkit-overflow-scrolling:touch}
    .account-nav a{white-space:nowrap;padding:8px 12px;font-size:13px;border-radius:6px;background:var(--bg-alt)}
    .account-nav a.active{background:rgba(142,33,42,.1)}
    .account-nav a svg{width:15px;height:15px}
    .account-nav form{display:none}

    /* Account content */
    .account-content{padding:18px 14px;border-radius:12px}
    .account-content h2{font-size:18px;margin-bottom:16px}
    .account-section h3{font-size:14px;margin-bottom:10px}

    /* Stats */
    .account-stats{grid-template-columns:repeat(3,1fr);gap:8px}
    .account-stat{padding:10px 6px;border-radius:8px}
    .account-stat .num{font-size:15px}
    .account-stat .label{font-size:10px}

    /* Order rows */
    .account-order-row{flex-wrap:wrap;gap:8px;padding:12px}
    .account-order-id{min-width:auto;font-size:13px}
    .account-order-info{width:100%;order:3}
    .account-order-total{margin-left:auto}

    /* Grids */
    .account-grid-2{grid-template-columns:1fr}
    .account-grid-3{grid-template-columns:1fr}
    .account-grid-full{grid-column:auto}

    /* Order detail */
    .od-totals{max-width:100%}
    .od-item{gap:10px}
    .od-item-img{width:42px;height:42px}
    .od-item-name{font-size:13px}

    /* Profile form */
    .account-content .form-group{margin-bottom:12px}
    .account-content .form-group label{font-size:13px}
}

@media(max-width:400px){
    .account-stats{grid-template-columns:1fr 1fr 1fr;gap:6px}
    .account-stat .num{font-size:13px}
    .account-content{padding:14px 12px}
    .account-order-row{padding:10px}
}
