/* ==========================================================================
   Stage layout
   ========================================================================== */

.iw-gcf-stage {
    margin: 40px auto;
}

.iw-gcf-stage--search {
    max-width: 520px;
}

.iw-gcf-stage--account {
    max-width: 980px;
}

.iw-gcf-stage--devalidate {
    max-width: 640px;
}


/* ==========================================================================
   Card container
   ========================================================================== */

.gift-certificate-form {
    padding: 28px;
    background: #fff;
    border: 1px solid var(--theme-palette-color-2);
    border-radius: 10px;
    box-sizing: border-box;
}

.gift-certificate-form--search,
.gift-certificate-form--account,
.gift-certificate-form--devalidate {
    width: 100%;
}


/* ==========================================================================
   Progress steps
   ========================================================================== */

.iw-gcf-steps {
    margin-bottom: 18px;
}

.iw-gcf-steps-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    gap: 12px;
    justify-content: space-between;
    align-items: flex-start;
}

.iw-gcf-step {
    flex: 1 1 0;
    position: relative;
    text-align: center;
}

.iw-gcf-step:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 18px;
    left: calc(50% + 24px);
    right: calc(-50% + 24px);
    height: 2px;
    background: var(--theme-palette-color-2);
    z-index: 0;
}

.iw-gcf-step-marker {
    position: relative;
    z-index: 1;
    width: 36px;
    height: 36px;
    margin: 0 auto 8px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 14px;
    background: #fff;
    border: 2px solid var(--theme-palette-color-2);
    color: var(--theme-palette-color-2);
}

.iw-gcf-step-label {
    display: block;
    font-size: 14px;
    line-height: 1.3;
    color: var(--theme-palette-color-2);
    font-weight: 600;
}

.iw-gcf-step.is-active .iw-gcf-step-marker {
    background: var(--theme-palette-color-1);
    border-color: var(--theme-palette-color-1);
    color: #fff;
}

.iw-gcf-step.is-active .iw-gcf-step-label {
    color: var(--theme-palette-color-1);
}

.iw-gcf-step.is-completed .iw-gcf-step-marker {
    background: var(--theme-palette-color-2);
    border-color: var(--theme-palette-color-2);
    color: #fff;
}

.iw-gcf-step.is-completed .iw-gcf-step-label {
    color: var(--theme-palette-color-2);
}

.iw-gcf-step.is-completed:not(:last-child)::after {
    background: var(--theme-palette-color-2);
}


/* ==========================================================================
   Messages and notices
   ========================================================================== */

.gift-certificate-form .iw-gcf-message {
    margin-top: 10px;
    margin-bottom: 14px;
    padding: 12px 14px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.45;
}

.gift-certificate-form .iw-gcf-message-error {
    background: #fff1f1;
    border: 1px solid #e0a4a4;
    color: #a12622;
}

.gift-certificate-form .iw-gcf-message-success,
.gift-certificate-form .iw-gcf-success {
    background: #eefaf0;
    border: 1px solid #9ed3aa;
    color: #216a35;
    padding: 12px 14px;
    border-radius: 8px;
    margin-top: 12px;
}

/* ==========================================================================
   Mode notice (TEST / PROD)
   ========================================================================== */

.iw-gcf-mode-notice {
    margin-bottom: 16px;
    padding: 10px 14px;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
}

.iw-gcf-mode-test {
    background: #fff1f1;
    border: 1px solid #e0a4a4;
    color: #a12622;
}

/* ==========================================================================
   Form structure
   ========================================================================== */

.gift-certificate-form .form-row {
    margin-bottom: 16px;
}

.gift-certificate-form label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
}

.gift-certificate-form .required {
    color: #b32d2e;
}


/* ==========================================================================
   Form fields
   ========================================================================== */

.gift-certificate-form input[type="text"],
.gift-certificate-form input[type="email"],
.gift-certificate-form input[type="password"],
.gift-certificate-form input[type="tel"],
.gift-certificate-form select {
    width: 100%;
    max-width: 100%;
    min-height: 42px;
    padding: 10px 12px;
    border: 1px solid var(--theme-palette-color-2);
    border-radius: 6px;
    background: #fff;
    box-sizing: border-box;
}

.gift-certificate-form input[type="text"]:focus,
.gift-certificate-form input[type="email"]:focus,
.gift-certificate-form input[type="password"]:focus,
.gift-certificate-form input[type="tel"]:focus,
.gift-certificate-form select:focus {
    outline: none;
    border-color: var(--theme-palette-color-2);
    box-shadow: 0 0 0 1px var(--theme-palette-color-1);
}


/* ==========================================================================
   Buttons
   ========================================================================== */

.gift-certificate-form input[type="submit"] {
    width: 100%;
    max-width: 100%;
    padding: 10px 16px;
    border: 0;
    border-radius: 6px;
    cursor: pointer;
    text-transform:uppercase;
}


/* ==========================================================================
   Account step layout
   ========================================================================== */

.iw-gcf-account-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 24px;
    margin-top: 20px;
}

.iw-gcf-account-panel {
    padding: 24px;
    border: 1px solid var(--theme-palette-color-2);
    border-radius: 10px;
    background: #fff;
}

.iw-gcf-account-panel h3 {
    margin-top: 0;
    margin-bottom: 8px;
}

.iw-gcf-account-panel p {
    margin-top: 0;
}

.iw-gcf-login-form .iw-gcf-message,
.iw-gcf-register-form .iw-gcf-message {
    margin-top: 0;
    margin-bottom: 14px;
}


/* ==========================================================================
   Devalidation step
   ========================================================================== */

.iw-gcf-devalidate-form .woocommerce-shipping-fields__title {
    margin-bottom: 18px;
}


/* ==========================================================================
   Responsive styles
   ========================================================================== */

@media (min-width: 768px) {
    .iw-gcf-account-grid {
        grid-template-columns: 1fr 1fr;
        align-items: start;
    }
}

@media (max-width: 767px) {
    .iw-gcf-steps-list {
        gap: 8px;
    }

    .iw-gcf-step-marker {
        width: 32px;
        height: 32px;
        font-size: 13px;
    }

    .iw-gcf-step-label {
        font-size: 12px;
    }

    .iw-gcf-step:not(:last-child)::after {
        top: 16px;
        left: calc(50% + 20px);
        right: calc(-50% + 20px);
    }

    .gift-certificate-form {
        padding: 20px;
    }
}