/* ================================================================
   Chichilas Warranty Management
   ================================================================ */

/* ========== Container ========== */
.cwm-warranty-container {
    max-width: 600px;
    width: 100%;
    padding: 30px;
    background-color: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    margin: 0 auto;
}

/* ========== Form ========== */
.cwm-form-section {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.cwm-form-section label {
    font-size: 1.2rem;
    color: #333;
    font-weight: 600;
}

.cwm-form-section textarea,
.cwm-form-section input[type="email"],
.cwm-form-section input[type="text"] {
    padding: 15px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s ease;
    width: 100%;
    box-sizing: border-box;
}

.cwm-form-section input[type="text"]:focus,
.cwm-form-section input[type="email"]:focus,
.cwm-form-section textarea:focus {
    border-color: #007bff;
}

.cwm-form-section button {
    padding: 15px;
    background-color: #007bff;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.2s ease;
    width: 100%;
    box-sizing: border-box;
    display: flex;
    justify-content: center;
}

.cwm-form-section button:hover {
    background-color: #0056b3;
    transform: translateY(-2px);
}

.cwm-input-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

#cwm-register-button {
    margin-top: 20px;
}

.cwm-form-success {
    background-color: #0bb700;
    color: #ffffff;
    text-align: center;
    border-radius: 7px;
    padding: 15px 10px;
}

/* ========== Results ========== */
#cwm-warranty-results {
    margin-top: 30px;
    border-top: 1px solid #eee;
    padding-top: 30px;
}

#cwm-registration-fields {
    margin-top: 30px;
    border-top: 1px solid #eee;
    padding-top: 30px;
}

#cwm-warranty-results h3 {
    font-size: 1.5rem;
    color: #007bff;
    margin-bottom: 20px;
    text-align: center;
}

#cwm-registration-fields h3 {
    font-size: 1.5rem;
    color: #555;
    text-align: center;
    margin-bottom: 20px;
}

/* ========== Legacy Result Card (kept for backward compatibility) ========== */
.cwm-warranty-result-card {
    padding: 25px;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    border: 1px solid #eee;
}

.cwm-result-item {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}

.cwm-result-item:last-child {
    border-bottom: none;
}

.cwm-result-item .cwm-label {
    font-weight: 500;
    color: #555;
}

.cwm-result-item .cwm-value {
    font-weight: 600;
    color: #333;
}

/* Status Colors */
.cwm-value.cwm-status-submitted { color: #000000; }
.cwm-value.cwm-status-awaiting  { color: #E67E22; }
.cwm-value.cwm-status-active    { color: #0bb700; }
.cwm-value.cwm-status-expired   { color: #dc3545; }

/* ========== Modern Warranty Card ========== */
.cwm-warranty-card-modern {
    background: #ffffff;
    border: 1px solid #e8ecf0;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    margin-bottom: 16px;
}

.cwm-warranty-card-modern::before {
    content: "";
    display: block;
    height: 4px;
    background: var(--card-accent, #38ada9);
}

.cwm-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 18px 12px;
}

.cwm-card-code {
    font-size: 18px;
    font-weight: 800;
    color: #0f172a;
    letter-spacing: 1px;
    font-family: "SF Mono", "Courier New", monospace;
    direction: ltr;
    text-align: right;
}

.cwm-card-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    white-space: nowrap;
}

.cwm-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
}

.cwm-card-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    border-top: 1px solid #f0f0f5;
}

.cwm-card-info {
    padding: 12px 18px;
    border-bottom: 1px solid #f0f0f5;
    border-inline-end: 1px solid #f0f0f5;
}

.cwm-card-info:nth-child(even) {
    border-inline-end: none;
}

.cwm-card-label {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 10px;
    color: #94a3b8;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 3px;
}

.cwm-card-label svg {
    width: 13px;
    height: 13px;
    opacity: 0.6;
}

.cwm-card-value {
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
}

/* Progress */
.cwm-progress-section {
    padding: 14px 18px 18px;
    border-top: 1px solid #f0f0f5;
}

.cwm-progress-bar-wrapper {
    width: 100%;
    height: 8px;
    background: #f0f0f5;
    border-radius: 4px;
    overflow: hidden;
}

.cwm-progress-bar {
    height: 100%;
    border-radius: 4px;
    transition: width 0.6s ease;
}

.cwm-progress-text {
    font-size: 12px;
    margin-top: 8px;
    font-weight: 500;
}

.cwm-progress-text strong {
    font-weight: 700;
}

/* ========== Authenticity Card ========== */
.cwm-authenticity-card {
    text-align: center;
    padding: 30px 20px;
}

.cwm-authenticity-check {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #e8f5e9;
    color: #2e7d32;
    font-size: 30px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.cwm-authenticity-card h3 {
    color: #2e7d32;
    margin-bottom: 8px;
}

.cwm-authenticity-message {
    font-size: 14px;
    color: #555;
    margin-bottom: 8px;
}

.cwm-authenticity-product {
    color: #1e293b;
    margin-top: 4px;
}

.cwm-authenticity-terms {
    margin-top: 12px;
    padding: 10px 14px;
    background: #f8f9fa;
    border-radius: 8px;
    font-size: 12px;
    color: #666;
    line-height: 1.8;
    text-align: right;
}

/* ========== Content Cards (Description & Terms) ========== */
.cwm-content-card {
    margin-top: 16px;
    background: #ffffff;
    border: 1px solid #e8ecf0;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.cwm-content-card-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    padding: 12px 16px;
    margin: 0;
    border-bottom: 1px solid #e8ecf0;
}

.cwm-content-card-title svg {
    flex-shrink: 0;
}

.cwm-content-card-body {
    padding: 16px;
    font-size: 13px;
    color: #4a5568;
    line-height: 2;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.cwm-content-card-body img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 8px 0;
}

.cwm-content-card-body p { margin-bottom: 10px; }

.cwm-content-card-body ul,
.cwm-content-card-body ol {
    padding-right: 20px;
    margin-bottom: 10px;
}

.cwm-content-card-body li { margin-bottom: 4px; }

.cwm-content-card-body a {
    color: #0071e3;
    text-decoration: underline;
}

/* Terms special */
.cwm-terms-item {
    border-bottom: none !important;
    padding-bottom: 0 !important;
}

.cwm-terms-content {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 12px 15px;
    margin: 8px 0 12px;
    font-size: 13px;
    color: #555;
    line-height: 1.8;
}

/* ========== Toast Notification ========== */
#cwm-toast {
    visibility: hidden;
    min-width: 250px;
    background-color: #333;
    color: #fff;
    text-align: center;
    border-radius: 8px;
    padding: 16px;
    position: fixed;
    z-index: 9999;
    right: 20px;
    bottom: 20px;
    font-size: 1rem;
    opacity: 0;
    transition: opacity 0.5s, visibility 0s 0.5s;
}

#cwm-toast.show {
    visibility: visible;
    opacity: 1;
    transition: opacity 0.5s;
}

#cwm-toast.success { background-color: #28a745; }
#cwm-toast.danger  { background-color: #dc3545; }
#cwm-toast.info    { background-color: #e66203; }

/* ========== Loader ========== */
.cwm-button-loader {
    width: 40px;
    aspect-ratio: 2;
    --_g: no-repeat radial-gradient(circle closest-side, #fff 90%, #0000);
    background:
        var(--_g) 0 50%,
        var(--_g) 50% 50%,
        var(--_g) 100% 50%;
    background-size: calc(100% / 3) 50%;
    animation: l3 1s infinite linear;
}

@keyframes l3 {
    20%  { background-position: 0 0, 50% 50%, 100% 50%; }
    40%  { background-position: 0 100%, 50% 0, 100% 50%; }
    60%  { background-position: 0 50%, 50% 100%, 100% 0; }
    80%  { background-position: 0 50%, 50% 50%, 100% 100%; }
}

/* ========== Card Link Buttons ========== */
.cwm-card-link {
    margin-top: 12px;
    text-align: center;
    display: flex;
    gap: 8px;
    justify-content: center;
    flex-wrap: wrap;
}

.cwm-btn-card {
    display: inline-block;
    background: #38ada9;
    color: #fff;
    padding: 8px 20px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
}

.cwm-copy-card-btn {
    display: inline-block;
    background: #f0f0f0;
    color: #333;
    padding: 8px 16px;
    border-radius: 20px;
    border: 1px solid #ddd;
    cursor: pointer;
    font-size: 13px;
    font-family: inherit;
}
.cwm-out-of-warranty {
    color: #c62828;
    font-weight: 600;
    font-size: 14px;
    margin: 10px 0;
}