﻿/* ==========================================================================
   E-Cards Global UI
   - Base resets, variables, typography
   - Buttons, inputs, cards, grid, utilities
   - Popups (keeps backward compatibility with your legacy .popup markup)
   ========================================================================== */

/* ==========================================================================
   E-Cards Global
   Base, variables, typography, buttons, inputs, cards, utilities, popups
   ========================================================================== */

:root {
    --font: "Poppins", Sans-serif;
    --text: #222;
    --muted: #6b7280;
    --bg: #fafafa;
    --surface: #fff;
    --border: #E4E0F6;
    --shadow: none; /* 0 1px 2px rgba(0, 0, 0, 0.04), 0 4px 12px rgba(0, 0, 0, 0.06); */

    --primary: #fff;
    --primary-600: #fff;
    --primary-700: #fff;

    --neutral-50: #f9fafb;
    --neutral-100: #f3f4f6;
    --neutral-200: #e5e7eb;
    --neutral-300: #d1d5db;

    --danger: #dc2626;
    --success: #16a34a;

    --radius: 12px;
    --radius-sm: 8px;
    --gap: 16px;
    --pad: 20px;
    --globa-color: #000;    
    
    --field-label-size: 16px;
    --field-label-color: #000;
    --field-label-line-height: 24px;
    --field-label-font-weight: 500;


    --h2: 35px;
    --h2-color: #000;
    --h2-line-height: 40px;
    --h2-font-weight: 700;
    --h3: 24px;
    --h3-color: #000;
    --h3-line-height: 24px;
    --h3-font-weight: 600;
}

/*
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{margin:0;font-family:var(--font);color:var(--text);background:#fff;line-height:1.55}
a{color:var(--primary);text-decoration:none}
a:hover{text-decoration:underline}
img,svg,video{display:block;max-width:100%;height:auto}
[hidden]{display:none!important}
*/


/* Buttons */
.yd-btn,
.btn-add-yahrzeit,
.btn-edit-user,
.yahrzeit-controls a,
.yahrzeit-controls button,
.btn-add-also-remind,
.btn-load-more,
.popup .btn-submit {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    height: 36px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid var(--neutral-300);
    background: var(--neutral-100);
    color: #111;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.06s ease;
}
.yd-btn:hover,
.btn-add-yahrzeit:hover,
.btn-edit-user:hover,
.btn-load-more:hover {
    background: var(--neutral-200);
}
.yd-btn:active,
.btn-add-yahrzeit:active,
.btn-edit-user:active {
    transform: translateY(1px);
}

.yd-btn-primary, 
.btn-add-yahrzeit,
.yd-btn-global{
    background: var(--primary);
    border-color: var(--primary);
    color: #000;
    padding: 10px 30px 10px 30px;
    border-radius: 0;
    border: 1px solid #000;
    text-transform: uppercase;
    font-size: 14px;
    font-weight: bold;
    letter-spacing: 0.5px;
    min-height: 50px;
    position: relative;
    min-width: 150px;
}

#page-container .yd-btn-global:hover{
    border-color: var(--text);
    color: var(--primary);
    background-color: var(--text);
}


.yd-btn-primary:hover,
.btn-add-yahrzeit:hover {
    background: var(--primary-600);
}
.yd-btn-danger {
    background: var(--danger);
    border-color: var(--danger);
    color: #fff;
}
.yd-btn-danger:hover {
    background: #b91c1c;
    border-color: #b91c1c;
}

.btn-pill {
    border-radius: 999px;
    padding: 6px 12px;
    height: auto;
}

/* Inputs / forms */
.yd-input,
.popup-form input[type="text"],
.popup-form input[type="email"],
.popup-form select,
#user-profile-form input,
#user-profile-form select {
    width: 100%;
    padding: 15px;
    border: 1px solid var(--neutral-300);
    border-radius: 8px;
    background: #fff;
    font-size: 16px;
    outline: none;
    transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.yd-input:focus,
#user-profile-form input:focus,
#user-profile-form select:focus,
.popup-form input:focus,
.popup-form select:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.yd-grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
@media (max-width: 720px) {
    .yd-grid-2 {
        grid-template-columns: 1fr;
    }
}

.yd-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 12px;
}

/* Cards */
.yd-card,
.user-card,
.yahrzeit-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: var(--pad);
}
.yd-card-head,
.user-header,
.yahrzeit-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 20px;
}


/* Popups (legacy) */
.popup {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
}
.popup.show {
    display: block;
}

/* ======================================================================
   Inline notices (global)
   Hooks for consistent styling across all pages:
   - container: .ecards-notice
   - message:   .ecards-notice__message
   - types:     .is-error | .is-success | .is-warning | .is-info
   ====================================================================== */

.ecards-notice {
    /* Default: hidden; JS toggles .is-visible and inline style display */
    display: none;
}

.ecards-notice.is-visible {
    display: block;
}

/* Optional close button for inline notices (enabled by JS with .ecards-notice--closable) */
.ecards-notice.ecards-notice--closable {
    margin-bottom: 30px;
    font-family: var(--font);
    font-size: 16px;
    font-weight: 400;
    color: #fff;
    background: #f70000;
    padding: 20px 36px 20px 20px;
}

.ecards-notice__close {
    position: absolute;
    top: 50%;
    right: 18px;
    border: 0;
    background: transparent;
    padding: 0;
    line-height: 1;
    cursor: pointer;
    font-size: 21px;
    color: #fff;
    transform: translateY(-50%);
}

.ecards-notice.is-error {
    position: relative;
    margin-bottom: 30px;
    font-family: var(--font);
    font-size: 16px;
    font-weight: 400;
    color: #fff;
    background: #f70000;
    padding: 20px 36px 20px 20px !important;
}

/* No visual styling here on purpose ” you can fully control it via CSS
   using the hooks above. */
.popup-content {
    background: #fff;
    padding: 24px;
    border-radius: 0;
    box-shadow: var(--shadow);
    width: min(560px, 92vw);
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.popup-content h2{
    margin-bottom: 10px;
    font-family: var(--font);
    font-size: var(--h2);
    line-height: var(--h2-line-height);
    font-weight: var(--h2-font-weight);
    color: var(--h2-color);
}

.popup-close-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #555;
    cursor: pointer;
}

.popup-close-btn{
    background-image: url(../img/close-btn.svg);
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

#notice-primary {
    background: #000;
    color: #fff !important;
    border-color: #000;
    border-radius: 0px;
    font-size: 14px;
    font-weight: 600 !important;
    background-color: #000;
    padding: 20px;
    cursor: pointer;
    min-width: 150px;
    margin-bottom: 0;
    border: none;
    min-height: 50px;
}

.popup h3 {
    margin: 0 0 12px;
}
.popup .popup-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    margin-top: 25px;
    margin-bottom: 10px;
}
.popup-form label {
    display: block;
    margin: 10px 0 6px;
}
.popup-form label {
    font-family: var(--font);
    font-size: var(--field-label-size);
    line-height: var(--field-label-line-height);
    font-weight: var(--field-label-font-weight);
    color: var(--field-label-color);
}

/* global UI used by ecards-deceased-details.js */
.dd-loader {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.55);
    z-index: 9999;
}
.dd-loader.show {
    display: flex;
}

.dd-spinner {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 4px solid #ddd;
    border-top-color: #111;
    animation: ddspin 0.9s linear infinite;
}

@keyframes ddspin {
    to {
        transform: rotate(360deg);
    }
}

.dd-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    display: none;
    z-index: 9998;
}

.dd-overlay.show {
    display: block;
}
.dd-modal {
    position: fixed;
    inset: 0;
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}
.dd-modal.show {
    display: flex;
}
.dd-card {
    background: #fff;
    border-radius: 10px;
    max-width: 520px;
    width: 92%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    overflow: hidden;
}
.dd-card-h {
    font-weight: 600;
    padding: 14px 16px;
    border-bottom: 1px solid #eee;
}
.dd-card-b {
    padding: 16px;
}
.dd-card-f {
    padding: 12px 16px;
    border-top: 1px solid #eee;
    text-align: right;
}
.dd-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid #e5e7eb;
    background: #111;
    color: #fff;
    cursor: pointer;
}
.dd-btn-danger {
    background: #b91c1c;
    border-color: #991b1b;
}
.dd-hint {
    margin-top: 6px;
    font-size: 12px;
    color: #4b5563;
}

/* field errors */
.dd-error {
    border-color: #e11d48 !important;
    box-shadow: 0 0 0 1px rgba(225, 29, 72, 0.25);
}
.dd-error-msg {
    color: #e11d48;
    font-size: 12px;
    margin-top: 4px;
}

.password-wrapper {
    position: relative;
}

.password-switcher {
    width: 25px;
    height: 20px;
    display: inline-block;
    position: absolute;
    bottom: 15px;
    right: 20px;
    background-image: url(../img/eyes-close.svg);
    background-position: center;
    background-size: contain;
    background-repeat: no-repeat;
    z-index: 1;
    cursor: pointer;
}

.password-switcher.active {
    background-image: url(../img/eyes-open.svg);
}

.password-switcher.active {
    bottom: 19px;
}

/* === Global full-screen preloader === */
#ecards-preloader {
    position: fixed;
    inset: 0; /* top:0; right:0; bottom:0; left:0 */
    background: rgba(255, 255, 255, 0.8);
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    transition: opacity 0.15s ease;
    opacity: 0;
}
#ecards-preloader.show {
    display: flex;
    opacity: 1;
}

#ecards-preloader .ecards-spinner {
    width: 56px;
    height: 56px;
    border: 4px solid rgba(0, 0, 0, 0.12);
    border-top-color: rgba(0, 0, 0, 0.7);
    border-radius: 50%;
    animation: ecards-spin 0.9s linear infinite;
}

.yahrzeit-login-form .form-group,
.yahrzeit-register-form .form-group{
    margin-bottom: 15px;
}

.yahrzeit-login-form .form-group > div,
.yahrzeit-register-form .form-group > div{
    float: none;
    width: 100%;
}


/* Field-level errors (shared hook) */
.ecards-field-error{
    display: none;
    margin: 6px 0 10px;
    font-size: 13px;
    line-height: 1.3;
    color: #dc2626;
}

.ecards-field-error.is-visible{
    display: block;
}

.field-error{
    color: red;
}




@keyframes ecards-spin {
    to {
        transform: rotate(360deg);
    }
}

body.ecards-loading {
    overflow: hidden;
}



.ecards-notice.is-error { }
.ecards-notice.is-error h2{
    text-align: left;
    margin-top: 15px;
}

.ecards-notice.is-error .popup-actions{
    justify-content: flex-end;
}

.ecards-notice.is-error .popup-content{
    width: min(560px, 92vw);
}

.ecards-notice.is-error .yd-btn-primary,
.ecards-notice.is-error .btn-add-yahrzeit{
    padding: 10px 30px 10px 30px;
}

.ecards-notice.is-success { }

.ecards-notice.is-warning { }

.ecards-notice.is-info { }



.ecards-notice__message { }


@media( max-width: 767px){
   #yd-root{
      padding: 10px 15px;
   }

   .question-icon{
        display: none;
   }
}