/* Merchant profile page (business details, logo upload, branding). Extracted from templates/profile.html. Shares design tokens with css/base.css (homepage nav/footer shell).

/* ── page shell ── */
.profile-page {
    padding: 100px 0 80px;
    min-height: 100vh;
}

/* ── page header ── */
.profile-header {
    margin-bottom: 36px;
}
.profile-header-inner {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 20px;
    flex-wrap: wrap;
}
.profile-eyebrow {
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: var(--g);
    margin-bottom: 8px;
}
.profile-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.9rem;
    font-weight: 700;
    color: var(--text-1);
    line-height: 1.1;
    margin-bottom: 6px;
}
.profile-sub {
    font-size: 0.85rem;
    color: var(--text-2);
}

/* completion ring badge */
.completion-badge {
    display: flex;
    align-items: center;
    gap: 14px;
    background: var(--ink-2);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: 14px 18px;
    flex-shrink: 0;
}
.ring-wrap {
    position: relative;
    width: 52px; height: 52px;
    flex-shrink: 0;
}
.ring-wrap svg { transform: rotate(-90deg); }
.ring-bg  { stroke: rgba(255,255,255,0.06); }
.ring-fill {
    stroke: var(--g);
    stroke-dasharray: 0 113;
    stroke-linecap: round;
    transition: stroke-dasharray 0.9s cubic-bezier(0.22,1,0.36,1);
    filter: drop-shadow(0 0 4px rgba(0,230,118,0.4));
}
.ring-pct {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--g);
}
.completion-info-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-1);
    margin-bottom: 3px;
}
.completion-info-sub {
    font-size: 0.75rem;
    color: var(--text-3);
}

/* completion bar under header */
.completion-bar-wrap {
    background: var(--ink-3);
    border-radius: 4px;
    height: 4px;
    overflow: hidden;
    margin-bottom: 32px;
}
.completion-bar-fill {
    height: 100%;
    background: linear-gradient(90deg, #00c853, var(--g));
    border-radius: 4px;
    box-shadow: 0 0 8px rgba(0,230,118,0.3);
    width: 0%;
    transition: width 0.9s cubic-bezier(0.22,1,0.36,1);
}

/* ── section cards ── */
.profile-section {
    background: var(--ink-2);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    overflow: hidden;
    margin-bottom: 20px;
}
.section-head {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 18px 24px;
    border-bottom: 1px solid var(--border);
}
.section-head-icon {
    width: 34px; height: 34px;
    border-radius: 9px;
    background: rgba(0,230,118,0.08);
    border: 1px solid rgba(0,230,118,0.16);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    color: var(--g);
    flex-shrink: 0;
}
.section-head-text {}
.section-head-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--text-1);
    margin-bottom: 1px;
}
.section-head-sub {
    font-size: 0.74rem;
    color: var(--text-3);
}
.section-body { padding: 24px; }

/* ── form fields ── */
.field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
    margin-bottom: 18px;
}
.field-row.single { grid-template-columns: 1fr; }
@media (max-width: 640px) { .field-row { grid-template-columns: 1fr; } }

.field { display: flex; flex-direction: column; gap: 7px; }
.field-label {
    font-size: 0.76rem;
    font-weight: 600;
    color: var(--text-2);
    letter-spacing: 0.3px;
}
.field-hint {
    font-size: 0.7rem;
    color: var(--text-3);
    font-weight: 400;
    margin-left: 6px;
}
.field-input {
    padding: 11px 13px;
    background: var(--ink-3);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    color: var(--text-1);
    font-family: 'Inter', sans-serif;
    font-size: 0.87rem;
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
    width: 100%;
}
.field-input::placeholder { color: var(--text-3); }
.field-input:focus {
    border-color: var(--border-g);
    box-shadow: 0 0 0 3px var(--g-glow);
}
.field-input.is-valid {
    border-color: rgba(0,230,118,0.3);
}

/* business type radio cards */
.btype-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}
@media (max-width: 480px) { .btype-grid { grid-template-columns: 1fr; } }

.btype-label {
    position: relative;
    cursor: pointer;
}
.btype-label input[type="radio"] {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}
.btype-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 16px 12px;
    background: var(--ink-3);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    text-align: center;
    transition: border-color 0.2s, background 0.2s;
}
.btype-card-icon {
    font-size: 1.2rem;
    color: var(--text-3);
    transition: color 0.2s;
}
.btype-card-name {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-2);
    transition: color 0.2s;
}
.btype-card-desc {
    font-size: 0.68rem;
    color: var(--text-3);
    line-height: 1.4;
}
.btype-label input:checked + .btype-card {
    border-color: var(--border-g);
    background: rgba(0,230,118,0.06);
    box-shadow: 0 0 0 1px rgba(0,230,118,0.12);
}
.btype-label input:checked + .btype-card .btype-card-icon { color: var(--g); }
.btype-label input:checked + .btype-card .btype-card-name { color: var(--g); }
.btype-label:hover .btype-card { border-color: rgba(255,255,255,0.1); }

/* colour picker field */
.colour-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 13px;
    background: var(--ink-3);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    transition: border-color 0.2s, box-shadow 0.2s;
}
.colour-wrap:focus-within {
    border-color: var(--border-g);
    box-shadow: 0 0 0 3px var(--g-glow);
}
.colour-swatch {
    width: 28px; height: 28px;
    border-radius: 6px;
    border: 1px solid rgba(255,255,255,0.1);
    flex-shrink: 0;
    overflow: hidden;
    cursor: pointer;
}
.colour-swatch input[type="color"] {
    width: 100%;
    height: 100%;
    border: none;
    padding: 0;
    background: none;
    cursor: pointer;
    opacity: 0;
    position: absolute;
}
.colour-swatch-preview {
    width: 100%; height: 100%;
    pointer-events: none;
}
.colour-hex-input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-1);
    font-family: 'Space Grotesk', monospace;
    font-size: 0.88rem;
    font-weight: 600;
    outline: none;
    min-width: 0;
}
.colour-hex-input::placeholder { color: var(--text-3); }

/* language / state selects */
select.field-input {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23555' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    padding-right: 32px;
    cursor: pointer;
}

/* ── save bar ── */
.save-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    padding: 20px 24px;
    background: var(--ink-2);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    position: sticky;
    bottom: 20px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
.save-bar-info {
    font-size: 0.82rem;
    color: var(--text-3);
}
.save-bar-info strong { color: var(--text-2); font-weight: 600; }
.save-bar-actions { display: flex; gap: 10px; }

.btn-save {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 24px;
    background: var(--g);
    border: none;
    border-radius: var(--r-sm);
    color: #000;
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 0 20px var(--g-glow);
    transition: all 0.2s;
}
.btn-save:hover:not(:disabled) { background: #fff; box-shadow: 0 0 32px var(--g-glow-lg); }
.btn-save:disabled { opacity: 0.5; cursor: not-allowed; }

.btn-reset {
    padding: 11px 16px;
    background: none;
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    color: var(--text-3);
    font-family: 'Inter', sans-serif;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}
.btn-reset:hover { border-color: rgba(255,255,255,0.14); color: var(--text-2); }

.save-spinner {
    width: 14px; height: 14px;
    border: 2px solid rgba(0,0,0,0.2);
    border-top-color: #000;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    display: none;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── auth gate ── */
.auth-gate {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 60vh;
    text-align: center;
    gap: 16px;
}
.auth-gate i { font-size: 2.5rem; color: var(--text-3); }
.auth-gate h2 { font-family: 'Space Grotesk', sans-serif; font-size: 1.4rem; color: var(--text-1); }
.auth-gate p  { font-size: 0.85rem; color: var(--text-2); max-width: 320px; }

/* ── Logo upload section ── */
.logo-section{display:flex;gap:18px;align-items:flex-start;}
@media(max-width:560px){.logo-section{flex-direction:column;}}

.logo-preview-box{
    flex-shrink:0;
    width:72px;height:72px;
    border-radius:12px;
    background:var(--ink-3);
    border:1.5px solid var(--border);
    display:flex;align-items:center;justify-content:center;
    overflow:hidden;
    font-family:'Space Grotesk',sans-serif;
    font-size:1.65rem;font-weight:700;color:var(--g);
    user-select:none;transition:border-color .2s;
}
.logo-preview-box img{width:100%;height:100%;object-fit:cover;display:block;}
.logo-preview-box.has-logo{border-color:var(--border-g);}

.logo-upload-controls{flex:1;min-width:0;}

.logo-drop-zone{
    position:relative;
    border:1.5px dashed var(--border);
    border-radius:var(--r-sm);
    background:var(--ink-3);
    padding:14px 16px;
    text-align:center;
    cursor:pointer;
    transition:border-color .2s,background .2s;
}
.logo-drop-zone:hover,.logo-drop-zone.drag-over{
    border-color:var(--border-g);background:var(--g-glow);
}
.logo-drop-zone input[type="file"]{
    position:absolute;inset:0;opacity:0;cursor:pointer;width:100%;height:100%;
}
.logo-drop-icon{font-size:1rem;color:var(--g);margin-bottom:5px;}
.logo-drop-text{font-size:.75rem;color:var(--text-2);line-height:1.5;}
.logo-drop-text strong{color:var(--text-1);}
.logo-drop-hint{font-size:.67rem;color:var(--text-3);margin-top:3px;}
.logo-uploading{display:none;align-items:center;justify-content:center;gap:8px;font-size:.75rem;color:var(--text-2);padding:2px 0;}
.logo-upload-spinner{width:14px;height:14px;border:2px solid rgba(0,230,118,.2);border-top-color:var(--g);border-radius:50%;animation:spin .6s linear infinite;flex-shrink:0;}
.logo-url-divider{display:flex;align-items:center;gap:10px;margin:11px 0 9px;}
.logo-url-divider::before,.logo-url-divider::after{content:'';flex:1;height:1px;background:var(--border);}
.logo-url-divider span{font-size:.66rem;font-weight:700;color:var(--text-3);white-space:nowrap;text-transform:uppercase;letter-spacing:.5px;}

/* ── Light mode logo overrides ── */
html[data-theme="light"] .logo-drop-zone{border-color:rgba(0,0,0,.14);background:var(--ink-3);}
html[data-theme="light"] .logo-drop-zone:hover{border-color:rgba(0,168,82,.45);}

/* missing field tag in section head */
.missing-tag {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 100px;
    font-size: 0.67rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    background: rgba(239,68,68,0.1);
    border: 1px solid rgba(239,68,68,0.22);
    color: #f87171;
}
.complete-tag {
    margin-left: auto;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 3px 9px;
    border-radius: 100px;
    font-size: 0.67rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    background: rgba(0,230,118,0.08);
    border: 1px solid rgba(0,230,118,0.2);
    color: var(--g);
}
