/* ============================================================
   Anne Defteri — Dashboard & Auth Pages Stylesheet
   Extends style.css palette (palette + container).
   ============================================================ */

/* ---------- Auth pages (login, register, forgot, reset) ---------- */
.auth-shell {
    min-height: calc(100vh - 80px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
}
.auth-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: 40px 36px;
    max-width: 440px;
    width: 100%;
}
.auth-card h1 {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.5px;
    margin-bottom: 8px;
    color: var(--ink);
}
.auth-card .auth-sub {
    color: var(--ink-soft);
    font-size: 14.5px;
    margin-bottom: 28px;
    line-height: 1.55;
}
.auth-card .auth-foot {
    margin-top: 22px;
    text-align: center;
    font-size: 14px;
    color: var(--muted);
}
.auth-card .auth-foot a { font-weight: 600; }
.auth-card .auth-extra-link {
    display: block;
    margin-top: 14px;
    text-align: right;
    font-size: 13px;
}

/* ---------- Form elements ---------- */
.form-group { margin-bottom: 18px; }
.form-group label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--ink-soft);
    margin-bottom: 6px;
    letter-spacing: 0.1px;
}
.form-group .field-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: var(--muted);
}
.input,
.textarea,
.select {
    width: 100%;
    padding: 12px 14px;
    font-size: 15px;
    font-family: inherit;
    color: var(--ink);
    background: #fff;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.input:focus,
.textarea:focus,
.select:focus {
    border-color: var(--coral);
    box-shadow: 0 0 0 3px rgba(232, 110, 86, 0.12);
}
.input.has-error,
.textarea.has-error {
    border-color: #d8443a;
    box-shadow: 0 0 0 3px rgba(216, 68, 58, 0.1);
}
.field-error {
    display: block;
    margin-top: 6px;
    font-size: 12.5px;
    color: #d8443a;
    font-weight: 500;
}

.checkbox-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 18px;
    font-size: 13.5px;
    color: var(--ink-soft);
    line-height: 1.5;
}
.checkbox-row input[type="checkbox"] {
    margin-top: 3px;
    width: 16px;
    height: 16px;
    accent-color: var(--coral);
}

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 22px;
    font-size: 15px;
    font-weight: 600;
    font-family: inherit;
    color: #fff;
    background: var(--ink);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: transform 0.1s ease, background 0.15s ease, box-shadow 0.15s ease;
    text-decoration: none;
}
.btn:hover {
    background: var(--coral);
    color: #fff;
    text-decoration: none;
    box-shadow: 0 6px 18px rgba(232, 110, 86, 0.22);
}
.btn:active { transform: translateY(1px); }
.btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    background: var(--muted);
    box-shadow: none;
}
.btn-block { width: 100%; }
.btn-primary {
    background: linear-gradient(135deg, var(--coral) 0%, #d65a44 100%);
}
.btn-primary:hover {
    background: linear-gradient(135deg, #d65a44 0%, var(--coral) 100%);
}
.btn-ghost {
    background: transparent;
    color: var(--ink);
    border: 1.5px solid var(--border);
}
.btn-ghost:hover {
    background: rgba(232, 110, 86, 0.08);
    color: var(--coral);
    border-color: rgba(232, 110, 86, 0.3);
    box-shadow: none;
}
.btn-danger {
    background: #d8443a;
}
.btn-danger:hover {
    background: #b8362d;
    box-shadow: 0 6px 18px rgba(216, 68, 58, 0.25);
}

/* ============================================================
   Pricing & Checkout
   ============================================================ */

/* ---------- Plan toggle (Aylık/Yıllık) ---------- */
.plan-toggle {
    display: inline-flex;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 4px;
    margin: 0 auto 32px;
    gap: 4px;
    box-shadow: var(--shadow);
}
.plan-toggle button {
    border: none;
    background: transparent;
    padding: 10px 24px;
    border-radius: 999px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 600;
    font-size: 14px;
    color: var(--ink-soft);
    transition: background 0.15s ease, color 0.15s ease;
    position: relative;
}
.plan-toggle button:hover {
    color: var(--coral);
}
.plan-toggle button.active {
    background: linear-gradient(135deg, var(--coral) 0%, #d65a44 100%);
    color: #fff;
    box-shadow: 0 4px 12px rgba(232, 110, 86, 0.22);
}
.plan-toggle .save-badge {
    display: inline-block;
    margin-left: 6px;
    padding: 2px 8px;
    background: rgba(64, 168, 100, 0.18);
    color: #1f6d3a;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.2px;
}
.plan-toggle button.active .save-badge {
    background: rgba(255, 255, 255, 0.25);
    color: #fff;
}

/* ---------- Pricing grid ---------- */
.pricing-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 22px;
    max-width: 880px;
    margin: 0 auto;
}
.pricing-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 32px 28px;
    box-shadow: var(--shadow);
    position: relative;
    display: flex;
    flex-direction: column;
}
.pricing-card.featured {
    border: 2px solid var(--coral);
    box-shadow: 0 12px 40px rgba(232, 110, 86, 0.14);
}
.pricing-card .featured-badge {
    position: absolute;
    top: -12px;
    right: 24px;
    padding: 4px 14px;
    background: linear-gradient(135deg, var(--coral) 0%, #d65a44 100%);
    color: #fff;
    border-radius: 999px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.pricing-card .plan-name {
    font-size: 20px;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 4px;
}
.pricing-card .plan-price {
    display: flex;
    align-items: baseline;
    gap: 6px;
    margin: 14px 0 4px;
}
.pricing-card .plan-price .amount {
    font-size: 38px;
    font-weight: 800;
    color: var(--ink);
    letter-spacing: -1px;
}
.pricing-card .plan-price .period {
    font-size: 14px;
    color: var(--muted);
}
.pricing-card .plan-sub {
    font-size: 13px;
    color: var(--ink-soft);
    margin-bottom: 22px;
}
.pricing-card ul.features {
    list-style: none;
    padding: 0;
    margin: 0 0 24px;
    flex: 1;
}
.pricing-card ul.features li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 8px 0;
    font-size: 14px;
    color: var(--ink-soft);
    line-height: 1.5;
    border-bottom: 1px solid var(--border);
}
.pricing-card ul.features li:last-child { border-bottom: none; }
.pricing-card ul.features li::before {
    content: '✓';
    flex-shrink: 0;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: rgba(64, 168, 100, 0.14);
    color: #1f6d3a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 700;
    margin-top: 2px;
}

/* ---------- Pricing notes + FAQ ---------- */
.pricing-note {
    text-align: center;
    color: var(--muted);
    font-size: 13.5px;
    margin: 24px auto;
    max-width: 720px;
    line-height: 1.5;
}
.pricing-faq {
    max-width: 720px;
    margin: 56px auto 0;
}

/* ---------- Checkout summary ---------- */
.checkout-summary {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 26px;
    box-shadow: var(--shadow);
    max-width: 480px;
    margin: 0 auto 24px;
}
.checkout-summary .row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
}
.checkout-summary .row:last-child { border-bottom: none; }
.checkout-summary .row .label {
    font-size: 14px;
    color: var(--ink-soft);
}
.checkout-summary .row .value {
    font-size: 16px;
    font-weight: 700;
    color: var(--ink);
}
.checkout-summary .row.total .value {
    font-size: 22px;
    color: var(--coral);
}

/* ---------- Subscription page ---------- */
.sub-detail-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 14px;
    margin-bottom: 22px;
}
.sub-detail-grid .stat-card {
    text-align: center;
}
.sub-detail-grid .stat-value {
    font-size: 17px;
}

/* Modal (cancel confirmation) */
.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(45, 45, 58, 0.55);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 20px;
    animation: fade-in 0.2s ease;
}
@keyframes fade-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.modal-card {
    background: #fff;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(45, 45, 58, 0.3);
    padding: 32px 28px;
    max-width: 460px;
    width: 100%;
    animation: modal-slide 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes modal-slide {
    from { transform: translateY(20px) scale(0.96); opacity: 0; }
    to   { transform: translateY(0) scale(1); opacity: 1; }
}
.modal-card h2 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 12px;
    color: var(--ink);
}
.modal-card p {
    color: var(--ink-soft);
    line-height: 1.55;
    margin-bottom: 20px;
}
.modal-card .modal-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

/* ---------- Invoices table ---------- */
.invoices-table {
    width: 100%;
    border-collapse: collapse;
}
.invoices-table th {
    text-align: left;
    padding: 12px 8px;
    font-size: 12px;
    font-weight: 700;
    color: var(--muted);
    text-transform: uppercase;
    letter-spacing: 0.4px;
    border-bottom: 2px solid var(--border);
}
.invoices-table td {
    padding: 14px 8px;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
    color: var(--ink);
}
.invoices-table tr:last-child td { border-bottom: none; }
.invoices-table .amount-col {
    font-weight: 600;
    color: var(--ink);
    text-align: right;
}
.invoices-table .pdf-link {
    color: var(--coral);
    font-size: 13px;
    font-weight: 600;
}
.invoices-table .pdf-link:hover { text-decoration: underline; }

@media (max-width: 600px) {
    .invoices-table thead { display: none; }
    .invoices-table tr {
        display: block;
        padding: 14px 0;
        border-bottom: 1px solid var(--border);
    }
    .invoices-table td {
        display: flex;
        justify-content: space-between;
        padding: 6px 0;
        border: none;
        font-size: 13px;
    }
    .invoices-table td::before {
        content: attr(data-label);
        color: var(--muted);
        font-weight: 600;
    }
}

/* ---------- "veya" divider (login/register sayfalarında) ---------- */
.or-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 22px 0;
    color: var(--muted);
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}
.or-divider::before,
.or-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ---------- Sign in with Apple button ----------
   Apple Brand Guidelines uyumlu:
   - Sabit yükseklik 44px
   - Tam metin: "Apple ile devam et" / "Continue with Apple"
   - Apple logo SVG (sol)
   - Beyaz arka plan + 1.5px ink stroke veya black solid
   Şu an: black solid (kontrast en yüksek).
*/
.btn-apple {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 0 22px;
    height: 46px;
    font-size: 15px;
    font-weight: 500;
    font-family: -apple-system, BlinkMacSystemFont, "Helvetica Neue", sans-serif;
    color: #fff;
    background: #000;
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    width: 100%;
    transition: background 0.15s ease, box-shadow 0.15s ease;
}
.btn-apple:hover {
    background: #1a1a1a;
    color: #fff;
    text-decoration: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.btn-apple:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    box-shadow: none;
}
.btn-apple svg {
    width: 16px;
    height: 16px;
    fill: #fff;
    flex-shrink: 0;
    /* Apple logo optical alignment — slight upward shift */
    margin-top: -2px;
}

/* ---------- Alerts / banners ---------- */
.alert {
    border-radius: var(--radius-sm);
    padding: 12px 16px;
    font-size: 14px;
    margin-bottom: 16px;
    line-height: 1.5;
}
.alert-success {
    background: rgba(64, 168, 100, 0.1);
    color: #1f6d3a;
    border-left: 3px solid #40a864;
}
.alert-error {
    background: rgba(216, 68, 58, 0.08);
    color: #b8362d;
    border-left: 3px solid #d8443a;
}
.alert-info {
    background: rgba(232, 110, 86, 0.06);
    color: var(--ink-soft);
    border-left: 3px solid var(--coral);
}
.alert-warning {
    background: rgba(255, 175, 64, 0.12);
    color: #8a5a00;
    border-left: 3px solid #ffaf40;
}

/* ---------- Dashboard layout ---------- */
.dash-shell {
    display: grid;
    grid-template-columns: 240px 1fr;
    gap: 28px;
    max-width: 1200px;
    margin: 32px auto;
    padding: 0 20px;
    align-items: start;
}

.dash-sidebar {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 16px 12px;
    box-shadow: var(--shadow);
    position: sticky;
    top: 100px;
}
.dash-sidebar nav { display: flex; flex-direction: column; gap: 2px; }
.dash-sidebar a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    color: var(--ink-soft);
    border-radius: var(--radius-sm);
    font-size: 14.5px;
    font-weight: 500;
    text-decoration: none;
    transition: background 0.12s ease, color 0.12s ease;
}
.dash-sidebar a:hover {
    background: rgba(232, 110, 86, 0.08);
    color: var(--coral);
    text-decoration: none;
}
.dash-sidebar a.active {
    background: linear-gradient(135deg, var(--peach), var(--rose));
    color: var(--ink);
    font-weight: 600;
}
.dash-sidebar a.danger { color: #d8443a; }
.dash-sidebar a.danger:hover { background: rgba(216, 68, 58, 0.08); color: #b8362d; }
.dash-sidebar .sidebar-icon {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}
.dash-sidebar .sidebar-divider {
    height: 1px;
    background: var(--border);
    margin: 8px 4px;
}

.dash-main {
    min-width: 0;  /* grid item shrink fix */
}

.dash-header {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}
.dash-header h1 {
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.5px;
    color: var(--ink);
    margin-bottom: 4px;
}
.dash-header .dash-sub {
    color: var(--ink-soft);
    font-size: 14.5px;
}

/* ---------- Dashboard cards ---------- */
.card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 24px 26px;
    box-shadow: var(--shadow);
    margin-bottom: 18px;
}
.card-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 14px;
}
.card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
    margin-bottom: 20px;
}
.stat-card {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 18px 20px;
    box-shadow: var(--shadow);
}
.stat-label {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: var(--muted);
    margin-bottom: 6px;
}
.stat-value {
    font-size: 22px;
    font-weight: 700;
    color: var(--ink);
    margin-bottom: 4px;
}
.stat-meta {
    font-size: 12.5px;
    color: var(--ink-soft);
}

/* ---------- Premium status pill ---------- */
.pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
    background: rgba(232, 110, 86, 0.12);
    color: var(--coral);
}
.pill-active {
    background: rgba(64, 168, 100, 0.14);
    color: #1f6d3a;
}
.pill-warning {
    background: rgba(255, 175, 64, 0.14);
    color: #8a5a00;
}

/* ---------- List rows (babies, invoices) ---------- */
.list-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 0;
    border-bottom: 1px solid var(--border);
}
.list-row:last-child { border-bottom: none; }
.list-row .list-avatar {
    width: 44px;
    height: 44px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--peach), var(--rose));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    flex-shrink: 0;
}
.list-row .list-main { flex: 1; min-width: 0; }
.list-row .list-title {
    font-weight: 600;
    color: var(--ink);
    margin-bottom: 2px;
}
.list-row .list-sub {
    font-size: 13px;
    color: var(--muted);
}

/* ---------- Empty state ---------- */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--muted);
}
.empty-state-icon { font-size: 40px; margin-bottom: 12px; }
.empty-state-title {
    font-weight: 600;
    color: var(--ink-soft);
    margin-bottom: 6px;
}
.empty-state-sub { font-size: 14px; }

/* ---------- Locale switcher ---------- */
.locale-switch {
    display: inline-flex;
    gap: 4px;
    background: rgba(232, 110, 86, 0.08);
    border-radius: 999px;
    padding: 3px;
    font-size: 12px;
    font-weight: 600;
}
.locale-switch button {
    border: none;
    background: transparent;
    cursor: pointer;
    padding: 5px 12px;
    border-radius: 999px;
    color: var(--muted);
    font-family: inherit;
    font-weight: 600;
    font-size: 12px;
    transition: background 0.12s ease, color 0.12s ease;
}
.locale-switch button:hover { color: var(--coral); }
.locale-switch button.active {
    background: #fff;
    color: var(--coral);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
}

/* ---------- Loading / spinners ---------- */
.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}
.btn .spinner { margin-right: 4px; }

/* ---------- Skeleton placeholder ---------- */
.skeleton {
    background: linear-gradient(90deg, rgba(232, 110, 86, 0.05), rgba(232, 110, 86, 0.12), rgba(232, 110, 86, 0.05));
    background-size: 200% 100%;
    animation: shimmer 1.4s ease-in-out infinite;
    border-radius: var(--radius-sm);
    height: 16px;
    width: 100%;
}
@keyframes shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ---------- Responsive ---------- */
@media (max-width: 880px) {
    .dash-shell {
        grid-template-columns: 1fr;
        gap: 18px;
    }
    .dash-sidebar {
        position: static;
        padding: 8px;
    }
    .dash-sidebar nav {
        flex-direction: row;
        overflow-x: auto;
        padding-bottom: 4px;
    }
    .dash-sidebar a {
        flex-shrink: 0;
        padding: 8px 14px;
    }
    .dash-sidebar .sidebar-divider { display: none; }
}

@media (max-width: 480px) {
    .auth-card { padding: 28px 22px; }
    .auth-card h1 { font-size: 22px; }
    .dash-header h1 { font-size: 22px; }
    .card { padding: 20px 18px; }
}
