/**
 * Inkeria OTP - Frontend Styles
 *
 * Uses CSS variables from theme for consistency
 */

/* Container */
.inkeria-otp-container {
    width: 100%;
}

/* Steps */
.inkeria-otp-step {
    display: none;
}

.inkeria-otp-step.active {
    display: block;
}

/* Form */
.inkeria-otp-form {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

/* Field */
.inkeria-otp-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.inkeria-otp-field label {
    font-size: var(--text-s);
    font-weight: 500;
}

.inkeria-otp-field input[type="text"],
.inkeria-otp-field input[type="email"],
.inkeria-otp-field input[type="tel"] {
    padding: 0.75rem 1rem;
    border: 1px solid var(--bricks-color-ketrbf);
    border-radius: var(--border-radius);
    font-size: var(--text-m);
    transition: border-color 0.2s ease;
}

.inkeria-otp-field input[type="text"]:focus,
.inkeria-otp-field input[type="email"]:focus,
.inkeria-otp-field input[type="tel"]:focus {
    outline: none;
    border-color: var(--bricks-color-qwekjg);
}

/* Field row (for side-by-side fields) */
.inkeria-otp-field-row {
    display: flex;
    gap: 1rem;
}

.inkeria-otp-field-row .inkeria-otp-field {
    flex: 1;
}

.inkeria-otp-field-row .inkeria-otp-field:first-child {
    flex: 0 0 35%;
}

/* Checkbox field */
.inkeria-otp-field-checkbox {
    flex-direction: row;
    align-items: center;
}

.inkeria-otp-field-checkbox label {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    cursor: pointer;
}

.inkeria-otp-field-checkbox input[type="checkbox"] {
    width: var(--text-l);
    height: var(--text-l);
    flex-shrink: 0;
    accent-color: var(--bricks-color-qwekjg);
}

/* Kundeklubb consent section */
.inkeria-otp-consent-section {
    margin-top: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--bricks-color-ketrbf);
}

.inkeria-otp-consent-heading {
    font-size: var(--text-s);
    font-weight: 600;
    margin: 0 0 0.75rem 0;
    color: var(--bricks-color-qwekjg);
}

.inkeria-otp-consent-newsletter,
.inkeria-otp-consent-newsletter-sms,
.inkeria-otp-consent-kundeklubb,
.inkeria-otp-consent-sms {
    align-items: flex-start;
}

.inkeria-otp-consent-newsletter label,
.inkeria-otp-consent-newsletter-sms label,
.inkeria-otp-consent-kundeklubb label,
.inkeria-otp-consent-sms label {
    align-items: flex-start;
}

.inkeria-otp-consent-newsletter span,
.inkeria-otp-consent-newsletter-sms span {
    font-size: var(--text-s);
    line-height: 1.4;
}

.inkeria-otp-consent-kundeklubb span,
.inkeria-otp-consent-sms span {
    font-size: var(--text-xs);
    line-height: 1.4;
    color: var(--bricks-color-ztkqdm);
}

.inkeria-otp-consent-newsletter-sms,
.inkeria-otp-consent-sms {
    margin-top: 0.5rem;
}

/* OTP Code inputs */
.inkeria-otp-code-inputs {
    display: flex;
    gap: 0.75rem;
    justify-content: center;
}

.inkeria-otp-digit {
    width: 3.5rem;
    height: 3.5rem;
    text-align: center;
    font-size: var(--header-s);
    font-weight: 600;
    border: 2px solid var(--bricks-color-ketrbf);
    border-radius: var(--border-radius);
    transition: border-color 0.2s ease;
}

.inkeria-otp-digit:focus {
    outline: none;
    border-color: var(--bricks-color-qwekjg);
}

.inkeria-otp-digit.has-value {
    border-color: var(--bricks-color-qwekjg);
    background-color: rgba(0, 0, 0, 0.02);
}

/* Button */
.inkeria-otp-button {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.875rem 1.5rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: var(--text-m);
    font-weight: 500;
    cursor: pointer;
    transition: opacity 0.2s ease, background-color 0.2s ease;
}

.inkeria-otp-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.inkeria-otp-button-primary {
    background-color: var(--bricks-color-qwekjg);
    color: #fff;
}

.inkeria-otp-button-primary:hover:not(:disabled) {
    opacity: 0.9;
}

/* Button loading state */
.inkeria-otp-button-loading {
    display: none;
    width: 1rem;
    height: 1rem;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: inkeria-otp-spin 0.8s linear infinite;
}

.inkeria-otp-button.loading .inkeria-otp-button-text {
    display: none;
}

.inkeria-otp-button.loading .inkeria-otp-button-loading {
    display: block;
}

@keyframes inkeria-otp-spin {
    to {
        transform: rotate(360deg);
    }
}

/* Info text */
.inkeria-otp-info {
    font-size: var(--text-s);
    color: var(--bricks-color-ztkqdm);
    text-align: center;
    margin: 0;
}

.inkeria-otp-display-email {
    display: block;
    margin-top: 0.25rem;
    color: var(--bricks-color-qwekjg);
    word-break: break-all;
}

/* Message */
.inkeria-otp-message {
    font-size: var(--text-s);
    text-align: center;
    min-height: 1.5em;
}

.inkeria-otp-message.success {
    color: #059669;
}

.inkeria-otp-message.error {
    color: var(--bricks-color-gdpfdx);
}

/* Actions */
.inkeria-otp-actions {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.inkeria-otp-link {
    background: none;
    border: none;
    color: var(--bricks-color-qwekjg);
    font-size: var(--text-s);
    cursor: pointer;
    text-decoration: underline;
    padding: 0;
}

.inkeria-otp-link:hover {
    opacity: 0.8;
}

.inkeria-otp-link:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    text-decoration: none;
}

.inkeria-otp-countdown {
    font-weight: 500;
}

/* Logged in message */
.inkeria-otp-logged-in {
    padding: 1rem;
    background-color: rgba(0, 0, 0, 0.02);
    border-radius: var(--border-radius);
    text-align: center;
}

.inkeria-otp-logged-in p {
    margin: 0;
    font-size: var(--text-s);
}
