/**
 * Certificate Generator - Frontend Styles
 * Design system matching main site aesthetic
 *
 * @package Certificate_Generator
 */

/* ===== Import Fonts ===== */
@import url('https://fonts.googleapis.com/css2?family=Jost:wght@100;200;300;400;500;600&family=Nunito:wght@300;400;500;600&display=swap');

/* ===== Form Wrapper ===== */
.cert-generator-wrapper {
    margin: 0;
    padding: 80px 0;
    width: 100%;
    font-family: 'Nunito', sans-serif;
    background: #FFFFFF;
    position: relative;
}

.cert-generator-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(175, 200, 203, 0.02) 0%, rgba(255, 255, 255, 0) 100%);
    pointer-events: none;
}

.cert-generator-wrapper * {
    box-sizing: border-box;
}

.cert-generator-form {
    max-width: 800px;
    margin: 0 auto;
    padding: 60px;
    background: #FFFFFF;
    border: 1px solid rgba(130, 140, 141, 0.12);
    position: relative;
    transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
}

.cert-generator-form::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: #AFC8CB;
    transition: width 0.6s cubic-bezier(0.19, 1, 0.22, 1);
}

.cert-generator-form:hover::before {
    width: 100%;
}

/* ===== Form Fields ===== */
.cert-form-fields {
    display: flex;
    flex-direction: column;
    gap: 30px;
    margin-bottom: 40px;
}

.cert-form-field {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cert-form-field label {
    font-family: 'Nunito', sans-serif;
    font-size: 13px;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 600;
    color: #202A2C;
    opacity: 0.7;
    display: flex;
    align-items: center;
    gap: 6px;
}

.cert-required {
    color: #AFC8CB;
    font-weight: 500;
}

.cert-input {
    width: 100%;
    padding: 18px 20px;
    border: 1px solid rgba(130, 140, 141, 0.2);
    background: #FFFFFF;
    font-family: 'Nunito', sans-serif;
    font-size: 16px;
    font-weight: 400;
    color: #202A2C;
    transition: all 0.3s cubic-bezier(0.19, 1, 0.22, 1);
}

.cert-input::placeholder {
    color: #828C8D;
    opacity: 0.5;
}

.cert-input:focus {
    outline: none;
    border-color: #AFC8CB;
    box-shadow: 0 4px 20px rgba(175, 200, 203, 0.1);
}

.cert-input:hover:not(:focus) {
    border-color: rgba(175, 200, 203, 0.4);
}

.cert-field-description {
    font-family: 'Nunito', sans-serif;
    font-size: 14px;
    font-weight: 300;
    line-height: 1.6;
    color: #828C8D;
    margin: 0;
}

.cert-form-required-notice {
    background: rgba(175, 200, 203, 0.1);
    padding: 15px 18px;
    border-left: 3px solid #AFC8CB;
    margin-top: 12px;
    color: #202A2C;
    font-weight: 400;
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.cert-form-required-notice .dashicons {
    color: #AFC8CB;
    flex-shrink: 0;
    margin-top: 2px;
    width: 18px;
    height: 18px;
    font-size: 18px;
}

.cert-form-required-notice a {
    color: #202A2C;
    font-weight: 600;
    text-decoration: underline;
    transition: color 0.3s ease;
}

.cert-form-required-notice a:hover {
    color: #AFC8CB;
}

/* ===== Form Actions ===== */
.cert-form-actions {
    margin-bottom: 30px;
}

.cert-submit-btn {
    font-family: 'Nunito', sans-serif;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    width: 100%;
    font-size: 13px;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-weight: 500;
    color: #FFFFFF;
    padding: 20px 40px;
    background: #202A2C;
    border: 1px solid #202A2C;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.cert-submit-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: #AFC8CB;
    transition: left 0.4s cubic-bezier(0.19, 1, 0.22, 1);
    z-index: -1;
}

.cert-submit-btn:hover:not(:disabled) {
    border-color: #AFC8CB;
    color: #202A2C;
}

.cert-submit-btn:hover:not(:disabled)::before {
    left: 0;
}

.cert-submit-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.cert-submit-btn.loading {
    pointer-events: none;
}

.cert-btn-text,
.cert-btn-loading {
    position: relative;
    z-index: 1;
}

.cert-btn-loading {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cert-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: currentColor;
    border-radius: 50%;
    animation: cert-spin 0.8s linear infinite;
}

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

/* ===== Messages ===== */
.cert-form-messages {
    margin-top: 25px;
}

.cert-message {
    padding: 20px 25px;
    margin-bottom: 20px;
    font-family: 'Nunito', sans-serif;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.6;
    border-left: 3px solid;
    background: rgba(175, 200, 203, 0.05);
}

.cert-message.cert-success {
    color: #202A2C;
    border-left-color: #AFC8CB;
}

.cert-message.cert-error {
    color: #202A2C;
    border-left-color: #828C8D;
    background: rgba(130, 140, 141, 0.05);
}

/* ===== Download Section ===== */
.cert-download-section {
    text-align: center;
    padding: 50px 40px;
    background: rgba(175, 200, 203, 0.04);
    border: 1px solid rgba(130, 140, 141, 0.1);
    margin-top: 40px;
    position: relative;
}

.cert-download-section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: #AFC8CB;
}

.cert-download-message {
    margin-bottom: 35px;
}

.cert-download-message h3 {
    font-family: 'Jost', sans-serif;
    font-size: 32px;
    font-weight: 300;
    letter-spacing: -1px;
    line-height: 1.2;
    color: #202A2C;
    margin: 0 0 15px 0;
}

.cert-download-message p {
    font-family: 'Nunito', sans-serif;
    font-size: 16px;
    font-weight: 300;
    line-height: 1.6;
    color: #828C8D;
    margin: 0;
}

.cert-email-info {
    margin-top: 12px;
}

.cert-download-btn {
    font-family: 'Nunito', sans-serif;
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
    letter-spacing: 2px;
    text-transform: uppercase;
    text-decoration: none;
    font-weight: 500;
    color: #FFFFFF;
    padding: 18px 40px;
    background: #202A2C;
    border: 1px solid #202A2C;
    transition: all 0.4s cubic-bezier(0.19, 1, 0.22, 1);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.cert-download-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: #AFC8CB;
    transition: left 0.4s cubic-bezier(0.19, 1, 0.22, 1);
    z-index: -1;
}

.cert-download-btn:hover {
    border-color: #AFC8CB;
    color: #202A2C;
    text-decoration: none;
}

.cert-download-btn:hover::before {
    left: 0;
}

.cert-download-btn svg {
    flex-shrink: 0;
    position: relative;
    z-index: 1;
}

.cert-download-btn span {
    position: relative;
    z-index: 1;
}

/* ===== Responsive Design ===== */
@media (max-width: 1024px) {
    .cert-generator-wrapper {
        padding: 60px 40px;
    }

    .cert-generator-form {
        padding: 50px;
    }
}

@media (max-width: 768px) {
    .cert-generator-wrapper {
        padding: 50px 30px;
    }

    .cert-generator-form {
        padding: 40px;
    }

    .cert-form-fields {
        gap: 25px;
        margin-bottom: 35px;
    }

    .cert-download-message h3 {
        font-size: 28px;
    }

    .cert-download-section {
        padding: 40px 30px;
    }
}

@media (max-width: 480px) {
    .cert-generator-wrapper {
        padding: 40px 20px;
    }

    .cert-generator-form {
        padding: 30px 25px;
    }

    .cert-form-fields {
        gap: 20px;
        margin-bottom: 30px;
    }

    .cert-form-field label {
        font-size: 12px;
        letter-spacing: 1.5px;
    }

    .cert-input {
        padding: 16px 18px;
        font-size: 15px;
    }

    .cert-submit-btn,
    .cert-download-btn {
        padding: 16px 32px;
        font-size: 12px;
        letter-spacing: 1.5px;
    }

    .cert-download-message h3 {
        font-size: 26px;
    }

    .cert-download-message p {
        font-size: 15px;
    }

    .cert-download-section {
        padding: 35px 25px;
        margin-top: 30px;
    }

    .cert-message {
        padding: 18px 20px;
        font-size: 14px;
    }
}

@media (max-width: 360px) {
    .cert-generator-wrapper {
        padding: 30px 15px;
    }

    .cert-generator-form {
        padding: 25px 20px;
    }

    .cert-form-field label {
        font-size: 11px;
    }

    .cert-input {
        padding: 14px 16px;
        font-size: 14px;
    }

    .cert-submit-btn,
    .cert-download-btn {
        padding: 14px 25px;
        font-size: 11px;
    }

    .cert-download-message h3 {
        font-size: 24px;
    }
}

/* ===== Accessibility ===== */
.cert-input:focus-visible {
    outline: 2px solid #AFC8CB;
    outline-offset: 2px;
}

.cert-submit-btn:focus-visible,
.cert-download-btn:focus-visible {
    outline: 2px solid #AFC8CB;
    outline-offset: 2px;
}

/* ===== Print Styles ===== */
@media print {
    .cert-generator-form,
    .cert-download-section {
        box-shadow: none;
        border: 1px solid rgba(0, 0, 0, 0.1);
    }

    .cert-generator-wrapper::before,
    .cert-generator-form::before,
    .cert-download-section::before {
        display: none;
    }
}
