/**
 * RES Simple Register — Frontend Styles
 */

/* Wrapper */
.rsr-wrap {
    max-width: 480px;
    margin: 2rem auto;
    font-family: inherit;
}

/* Notices */
.rsr-notice {
    padding: 0.85rem 1rem;
    margin-bottom: 1.25rem;
    border-radius: 6px;
    font-size: 0.92rem;
    line-height: 1.5;
}
.rsr-notice p { margin: 0; }
.rsr-notice--error   { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.rsr-notice--success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }
.rsr-notice--info    { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }

/* Form */
.rsr-form {
    display: flex;
    flex-direction: column;
    gap: 1.15rem;
}

.rsr-field label {
    display: block;
    margin-bottom: 0.35rem;
    font-weight: 600;
    font-size: 0.92rem;
    color: #1f2937;
}

.rsr-required { color: #dc2626; font-weight: 400; }

.rsr-field input[type="text"],
.rsr-field input[type="email"],
.rsr-field input[type="password"],
.rsr-field input[type="tel"],
.rsr-field input[type="url"],
.rsr-field input[type="number"],
.rsr-field input[type="date"],
.rsr-field textarea,
.rsr-field select {
    display: block;
    width: 100%;
    padding: 0.65rem 0.85rem;
    font-size: 0.95rem;
    line-height: 1.5;
    color: #1f2937;
    background: #fff;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    box-sizing: border-box;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    -webkit-appearance: none;
    appearance: none;
}

.rsr-field input:focus,
.rsr-field textarea:focus,
.rsr-field select:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.rsr-field input::placeholder,
.rsr-field textarea::placeholder {
    color: #9ca3af;
}

.rsr-field textarea {
    resize: vertical;
    min-height: 80px;
}

.rsr-field select {
    padding-right: 2rem;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236b7280' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 0.75rem center;
    background-size: 12px;
}

/* Radio & checkbox groups */
.rsr-radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin-top: 0.25rem;
}

.rsr-radio-label {
    display: flex;
    align-items: center;
    gap: 0.45rem;
    font-weight: 400 !important;
    font-size: 0.92rem;
    cursor: pointer;
}

.rsr-radio-label input[type="radio"] {
    width: 18px;
    height: 18px;
    accent-color: #2563eb;
    cursor: pointer;
}

/* Password toggle & strength */
.rsr-password-wrap { position: relative; }
.rsr-password-wrap input { padding-right: 3rem; }

.rsr-toggle-pw {
    position: absolute;
    right: 0.6rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.3rem;
    color: #6b7280;
    display: flex;
    align-items: center;
}
.rsr-toggle-pw:hover { color: #374151; }

.rsr-eye-icon {
    display: inline-block;
    width: 20px;
    height: 14px;
    position: relative;
}
.rsr-eye-icon::before {
    content: '';
    display: block;
    width: 20px;
    height: 14px;
    border: 2px solid currentColor;
    border-radius: 70% 70%;
    box-sizing: border-box;
}
.rsr-eye-icon::after {
    content: '';
    display: block;
    width: 6px;
    height: 6px;
    background: currentColor;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.rsr-password-strength {
    margin-top: 0.4rem;
    font-size: 0.82rem;
    font-weight: 500;
    min-height: 1.2em;
}
.rsr-password-strength[data-strength="weak"]   { color: #dc2626; }
.rsr-password-strength[data-strength="medium"] { color: #d97706; }
.rsr-password-strength[data-strength="strong"] { color: #16a34a; }

.rsr-password-match {
    margin-top: 0.4rem;
    font-size: 0.82rem;
    font-weight: 500;
    min-height: 1.2em;
}
.rsr-password-match.rsr-match    { color: #16a34a; }
.rsr-password-match.rsr-no-match { color: #dc2626; }

/* Checkbox field */
.rsr-field--checkbox label {
    display: flex;
    align-items: flex-start;
    gap: 0.55rem;
    font-weight: 400;
    cursor: pointer;
}
.rsr-field--checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    flex-shrink: 0;
    accent-color: #2563eb;
    cursor: pointer;
}
.rsr-field--checkbox span {
    font-size: 0.88rem;
    line-height: 1.45;
    color: #374151;
}
.rsr-field--checkbox a { color: #2563eb; text-decoration: underline; }
.rsr-field--checkbox a:hover { color: #1d4ed8; }

/* Submit */
.rsr-field--submit { margin-top: 0.5rem; }

.rsr-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.5;
    color: #fff;
    background: #2563eb;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s ease, box-shadow 0.2s ease;
}
.rsr-btn:hover { background: #1d4ed8; }
.rsr-btn:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(37,99,235,0.35); }
.rsr-btn:disabled, .rsr-btn.rsr-btn--loading { opacity: 0.65; cursor: not-allowed; }

.rsr-btn--loading::after {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    margin-left: 0.6rem;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: rsr-spin 0.6s linear infinite;
}
@keyframes rsr-spin { to { transform: rotate(360deg); } }

/* Responsive */
@media (max-width: 540px) {
    .rsr-wrap { margin: 1rem auto; padding: 0 0.75rem; }
}
