/* ===========================
   WebNow Warranty - Frontend CSS
   =========================== */

.wnwr-wrap {
    max-width: 960px;
    margin: 0 auto;
    padding: 24px 16px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 14px;
    color: #333;
}

/* Card */
.wnwr-card {
    background: #fff;
    border-radius: 10px;
    padding: 28px 32px;
    box-shadow: 0 1px 6px rgba(0,0,0,0.08);
    margin-bottom: 16px;
}

/* Title */
.wnwr-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 6px;
    color: #1a1a1a;
}

.wnwr-subtitle {
    font-size: 13px;
    color: #666;
    margin: 0 0 20px;
}

/* Serial Form */
.wnwr-serial-form {
    display: flex;
    gap: 10px;
    align-items: center;
}

.wnwr-input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
    background: #fff;
    box-shadow: unset;
    box-sizing: border-box;
    height: 44px;
}

.wnwr-input:focus {
    border-color: #009666;
}

input.wnwr-input.wnwr-input--serial{
    flex: 1;
}
input[type="text"], input[type=tel], input[type=email], input[type=date], .wnwr-field select, input.wnwr-input.wnwr-input--serial{
    height: 44px!important;
}

/* Buttons */
.wnwr-btn {
    padding: 7px 16px;
    border: none;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, opacity 0.2s;
    white-space: nowrap;
    font-family: inherit;
    display: inline-block;
    text-align: center;
}

.wnwr-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.wnwr-btn--primary {
    background: #009666;
    color: #fff;
}

.wnwr-btn--primary:hover:not(:disabled) {
    background: #007a4d;
}

.wnwr-btn--cancel {
    background: #f0f0f0;
    color: #555;
    border: 1px solid #ddd;
}

.wnwr-btn--cancel:hover {
    background: #e0e0e0;
}

/* Loading */
.wnwr-loading {
    display: none;
    text-align: center;
    padding: 16px;
}

.wnwr-loading.active {
    display: block;
}

.wnwr-spinner {
    width: 28px;
    height: 28px;
    border: 3px solid #e0e0e0;
    border-top-color: #009666;
    border-radius: 50%;
    animation: wnwr-spin 0.8s linear infinite;
    margin: 0 auto 8px;
}

@keyframes wnwr-spin {
    to { transform: rotate(360deg); }
}

/* Result Boxes */
.wnwr-result {
    padding: 16px 20px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 14px;
    display: none;
}

.wnwr-result.active {
    display: block;
}

.wnwr-result--success {
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
}

.wnwr-result--info {
    background: #e8f4f8;
    border: 1px solid #b8daE9;
    color: #0c5460;
}

.wnwr-result--error {
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
}

.wnwr-result__title {
    font-weight: 700;
    font-size: 15px;
}

.wnwr-result__action {
    margin-top: 12px;
}

.wnwr-result__customer {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(0,0,0,0.1);
}

.wnwr-result__row {
    margin: 3px 0;
}

/* Product info in result */
.wnwr-result__product {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(0,0,0,0.1);
    display: none;
}

.wnwr-product-info {
    display: flex;
    align-items: flex-start;
    gap: 12px;
}

.wnwr-product-image {
    width: 72px;
    height: 72px;
    object-fit: contain;
    border-radius: 6px;
    border: 1px solid rgba(0,0,0,0.1);
    background: #fff;
    flex-shrink: 0;
}

.wnwr-product-details {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.wnwr-product-name {
    font-weight: 600;
    font-size: 14px;
    color: inherit;
}

.wnwr-product-expiry {
    font-size: 12px;
    opacity: 0.85;
}

/* Activated result layout refinement */
#wnwr-result-activated .wnwr-result__row {
    margin: 6px 0;
}

#wnwr-result-activated .wnwr-result__product {
    display: block;
    margin-top: 12px;
    padding: 12px;
    border: 1px solid rgba(12,84,96,0.18);
    border-radius: 10px;
    background: rgba(255,255,255,0.65);
}

#wnwr-result-activated .wnwr-product-info {
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 18px;
}

#wnwr-result-activated .wnwr-product-image {
    width: 220px;
    height: 220px;
    border-radius: 12px;
}

#wnwr-result-activated .wnwr-product-details {
    align-items: center;
}

#wnwr-result-activated .wnwr-product-name {
    font-size: 18px;
    line-height: 1.35;
}

#wnwr-result-activated .wnwr-product-link,
#wnwr-result-unactivated .wnwr-product-link {
    color: #0b4f5b;
    text-decoration: underline;
    text-underline-offset: 3px;
}

#wnwr-result-unactivated .wnwr-product-info {
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 16px;
}

#wnwr-result-unactivated .wnwr-product-image {
    width: 220px;
    height: 220px;
    border-radius: 12px;
}

#wnwr-result-unactivated .wnwr-product-details {
    align-items: center;
}

#wnwr-result-unactivated .wnwr-product-name {
    font-size: 18px;
    line-height: 1.35;
}

@media (max-width: 768px) {
    #wnwr-result-activated .wnwr-product-info,
    #wnwr-result-unactivated .wnwr-product-info {
        flex-direction: column;
    }

    #wnwr-result-activated .wnwr-product-image,
    #wnwr-result-unactivated .wnwr-product-image {
        width: 160px;
        height: 160px;
    }
}

/* Activated result layout refinement */
#wnwr-result-activated .wnwr-result__row {
    margin: 6px 0;
}

#wnwr-result-activated .wnwr-result__product {
    display: block;
    margin-top: 12px;
    padding: 12px;
    border: 1px solid rgba(12,84,96,0.18);
    border-radius: 10px;
    background: rgba(255,255,255,0.65);
}

#wnwr-result-activated .wnwr-product-info {
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 18px;
}

#wnwr-result-activated .wnwr-product-image {
    width: 220px;
    height: 220px;
    border-radius: 12px;
}

#wnwr-result-activated .wnwr-product-details {
    align-items: center;
}

#wnwr-result-activated .wnwr-product-name {
    font-size: 18px;
    line-height: 1.35;
}

#wnwr-result-activated .wnwr-product-link,
#wnwr-result-unactivated .wnwr-product-link {
    color: #0b4f5b;
    text-decoration: underline;
    text-underline-offset: 3px;
}

#wnwr-result-unactivated .wnwr-product-info {
    align-items: center;
    justify-content: center;
    text-align: center;
    gap: 16px;
}

#wnwr-result-unactivated .wnwr-product-image {
    width: 220px;
    height: 220px;
    border-radius: 12px;
}

#wnwr-result-unactivated .wnwr-product-details {
    align-items: center;
}

#wnwr-result-unactivated .wnwr-product-name {
    font-size: 18px;
    line-height: 1.35;
}

@media (max-width: 768px) {
    #wnwr-result-activated .wnwr-product-info,
    #wnwr-result-unactivated .wnwr-product-info {
        flex-direction: column;
    }

    #wnwr-result-activated .wnwr-product-image,
    #wnwr-result-unactivated .wnwr-product-image {
        width: 160px;
        height: 160px;
    }
}

/* Registration Form */
.wnwr-form-card {
    display: none;
}

.wnwr-form-card.active {
    display: block;
}

.wnwr-form-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 20px;
    color: #1a1a1a;
}

/* Form Grid */
.wnwr-form-grid {
    display: grid;
    grid-template-columns: 140px 1fr 1fr;
    gap: 14px;
}

.wnwr-field {
    display: flex;
    flex-direction: column;
}

.wnwr-field--full {
    grid-column: 1 / -1;
}

.wnwr-field label {
    font-size: 12px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.wnwr-req {
    color: #dc3545;
}

.wnwr-field input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 13px;
    font-family: inherit;
    outline: none;
    transition: border-color 0.2s;
    background: #fff;
    box-shadow: unset;
    box-sizing: border-box;
    height: 44px;
}
input[type="checkbox"] {
    height: 13px;
}

.wnwr-field input:focus,
.wnwr-field select:focus {
    border-color: #009666;
}

.wnwr-field input[readonly] {
    background: #f5f5f5;
    color: #666;
}

.wnwr-field__error {
    font-size: 11px;
    color: #dc3545;
    margin-top: 2px;
    display: none;
}

.wnwr-field.has-error input,
.wnwr-field.has-error select {
    border-color: #dc3545;
}

.wnwr-field.has-error .wnwr-field__error {
    display: block;
}

/* Checkboxes */
.wnwr-check__label {
    font-size: 12px;
    font-weight: normal;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
}

.wnwr-check__label input[type="checkbox"] {
    width: auto;
}

/* Form Actions */
.wnwr-form-actions {
    grid-column: 1 / -1;
    display: flex;
    gap: 10px;
    margin-top: 6px;
}
.width-auto {
    width: 50%;
}
/* Responsive */
@media (max-width: 768px) {
    .wnwr-form-grid {
        grid-template-columns: 1fr 1fr;
    }
    .wnwr-field--full {
        grid-column: 1 / -1;
    }
    .wnwr-serial-form {
        flex-direction: column;
    }
    .wnwr-serial-form .wnwr-btn {
        width: 100%;
    }
    .width-auto {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .wnwr-form-grid {
        grid-template-columns: 1fr;
    }
    .width-auto {
        width: 100%;
    }
}
