/*
 * Raijanholvin Lahjakortti — style.css
 * Versio 4.0
 *
 * Väripaletti & typografia
 * -----------------------------------------
 * --rh-pine    #1a4d2e  (tumma vihreä, CTA)
 * --rh-leaf    #2d7a4a  (hover-vihreä)
 * --rh-moss    #e8f4ec  (vaaleaa taustausta)
 * --rh-gold    #b8860b  (korostus, summa)
 * --rh-ink     #1c1c1e  (otsikot)
 * --rh-mist    #f5f7f5  (lomakkeen tausta)
 * --rh-border  #d4ddd6  (reunaviivat)
 * --rh-error   #c0392b  (virheet)
 * -----------------------------------------
 */

:root {
    --rh-pine:    #1a4d2e;
    --rh-leaf:    #2d7a4a;
    --rh-moss:    #e8f4ec;
    --rh-gold:    #9a6f00;
    --rh-ink:     #1c1c1e;
    --rh-body:    #3a3a3c;
    --rh-mist:    #f5f7f5;
    --rh-white:   #ffffff;
    --rh-border:  #d4ddd6;
    --rh-error:   #c0392b;
    --rh-radius:  10px;
    --rh-shadow:  0 4px 24px rgba(26,77,46,0.10);
    --rh-trans:   0.18s ease;
}

/* =========================================
   WRAPPER
   ========================================= */

.rh-gift-wrapper {
    margin-top: 28px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: var(--rh-body);
}

/* =========================================
   LOMAKE
   ========================================= */

.rh-gift-form {
    max-width: 540px;
    background: var(--rh-white);
    border: 1px solid var(--rh-border);
    border-radius: calc(var(--rh-radius) * 1.6);
    box-shadow: var(--rh-shadow);
    overflow: hidden;
}

/* =========================================
   OTSIKKOALUE
   ========================================= */

.rh-form-header {
    background: var(--rh-pine);
    padding: 32px 28px 28px;
    text-align: center;
    color: var(--rh-white);
}

.rh-gift-icon {
    font-size: 40px;
    line-height: 1;
    margin-bottom: 10px;
}

.rh-form-header h3 {
    margin: 0 0 8px;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: -0.3px;
    color: var(--rh-white);
    border: none;
    padding: 0;
}

.rh-subtitle {
    margin: 0;
    font-size: 14px;
    opacity: 0.82;
    line-height: 1.5;
}

/* =========================================
   KENTTÄRYHMÄT
   ========================================= */

.rh-gift-form > *:not(.rh-form-header):not(.rh-total-bar):not(.rh-submit-btn) {
    padding-left: 28px;
    padding-right: 28px;
}

.rh-field-group {
    padding-left: 28px;
    padding-right: 28px;
    padding-top: 18px;
}

.rh-field-group:last-of-type {
    padding-bottom: 4px;
}

.rh-gift-form label {
    display: block;
    margin-bottom: 7px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    color: var(--rh-ink);
}

/* =========================================
   INPUTIT
   ========================================= */

.rh-gift-form input[type="number"],
.rh-gift-form input[type="email"],
.rh-gift-form input[type="text"],
.rh-gift-form textarea,
.rh-gift-form select {
    width: 100%;
    padding: 11px 14px;
    font-size: 15px;
    color: var(--rh-ink);
    background: var(--rh-mist);
    border: 1.5px solid var(--rh-border);
    border-radius: var(--rh-radius);
    box-sizing: border-box;
    transition: border-color var(--rh-trans), box-shadow var(--rh-trans), background var(--rh-trans);
    appearance: none;
    -webkit-appearance: none;
    outline: none;
}

.rh-gift-form input:focus,
.rh-gift-form textarea:focus,
.rh-gift-form select:focus {
    background: var(--rh-white);
    border-color: var(--rh-leaf);
    box-shadow: 0 0 0 3px rgba(45,122,74,0.15);
}

.rh-gift-form textarea {
    resize: vertical;
    min-height: 96px;
    line-height: 1.6;
}

/* Numeeriset kentät — poista piilota selainkohtaiset nuolet */
.rh-gift-form input[type="number"]::-webkit-inner-spin-button,
.rh-gift-form input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.rh-gift-form input[type="number"] {
    -moz-appearance: textfield;
}

/* SELECT-nuoli */
.rh-gift-form select {
    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 d='M1 1l5 5 5-5' stroke='%231a4d2e' stroke-width='1.8' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 38px;
    cursor: pointer;
}

/* Summakenttä + euro-pääte */
.rh-input-prefix {
    position: relative;
}

.rh-currency {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 15px;
    font-weight: 600;
    color: var(--rh-pine);
    pointer-events: none;
}

.rh-input-prefix input {
    padding-right: 36px;
}

/* =========================================
   VIHJEET & MERKKIMÄÄRÄ
   ========================================= */

.rh-hint {
    display: block;
    margin-top: 6px;
    font-size: 12px;
    color: #6c7a70;
    line-height: 1.4;
}

/* =========================================
   YHTEENSÄ-PALKKI
   ========================================= */

.rh-total-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin: 22px 28px 0;
    padding: 14px 18px;
    background: var(--rh-moss);
    border: 1px solid #c3deca;
    border-radius: var(--rh-radius);
}

.rh-total-label {
    font-size: 13px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.4px;
    color: var(--rh-pine);
}

.rh-total-amount {
    font-size: 22px;
    font-weight: 700;
    color: var(--rh-gold);
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.5px;
}

/* =========================================
   LÄHETYSPAINIKE
   ========================================= */

.rh-submit-btn {
    display: block;
    position: relative;
    width: calc(100% - 56px);
    margin: 24px 28px 28px;
    padding: 15px 20px;
    background: var(--rh-pine);
    color: var(--rh-white);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.2px;
    border: none;
    border-radius: var(--rh-radius);
    cursor: pointer;
    transition: background var(--rh-trans), transform var(--rh-trans), box-shadow var(--rh-trans);
    box-shadow: 0 3px 12px rgba(26,77,46,0.28);
    min-height: 52px;
}

.rh-submit-btn:hover {
    background: var(--rh-leaf);
    transform: translateY(-1px);
    box-shadow: 0 6px 18px rgba(26,77,46,0.32);
}

.rh-submit-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(26,77,46,0.22);
}

.rh-submit-btn:focus-visible {
    outline: 3px solid var(--rh-leaf);
    outline-offset: 3px;
}

/* Latausasento */
.rh-submit-btn.loading {
    opacity: 0.88;
    pointer-events: none;
    cursor: not-allowed;
}

.rh-submit-btn.loading .rh-btn-text {
    visibility: hidden;
}

/* =========================================
   SPINNER
   ========================================= */

.rh-spinner {
    display: none;
    position: absolute;
    top: 50%;
    left: 50%;
    width: 22px;
    height: 22px;
    margin-top: -11px;
    margin-left: -11px;
    border: 2.5px solid rgba(255,255,255,0.35);
    border-top-color: #fff;
    border-radius: 50%;
    animation: rh-spin 0.65s linear infinite;
}

.rh-submit-btn.loading .rh-spinner {
    display: block;
}

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

/* =========================================
   WooCommerce-ilmoitukset lomakkeen sisällä
   ========================================= */

.rh-gift-wrapper .woocommerce-error,
.rh-gift-wrapper .woocommerce-message,
.rh-gift-wrapper .woocommerce-info {
    margin-bottom: 16px;
    border-radius: var(--rh-radius);
    font-size: 14px;
}

/* =========================================
   RESPONSIIVISUUS
   ========================================= */

@media (max-width: 600px) {
    .rh-gift-form {
        border-radius: var(--rh-radius);
    }

    .rh-form-header {
        padding: 24px 20px 20px;
    }

    .rh-form-header h3 {
        font-size: 22px;
    }

    .rh-field-group,
    .rh-gift-form > *:not(.rh-form-header):not(.rh-total-bar):not(.rh-submit-btn) {
        padding-left: 18px;
        padding-right: 18px;
    }

    .rh-total-bar {
        margin-left: 18px;
        margin-right: 18px;
    }

    .rh-submit-btn {
        width: calc(100% - 36px);
        margin-left: 18px;
        margin-right: 18px;
    }
}

/* =========================================
   MOTION-ASETUKSET (esteettömyys)
   ========================================= */

@media (prefers-reduced-motion: reduce) {
    .rh-submit-btn,
    .rh-gift-form input,
    .rh-gift-form textarea,
    .rh-gift-form select {
        transition: none;
    }

    .rh-spinner {
        animation: none;
        border-color: rgba(255,255,255,0.6);
        border-top-color: #fff;
    }
}
