/**
 * ScrivoMail Registration - Frontend Styles
 */

/* Container */
.scrivomail-form-container {
    max-width: 480px;
    margin: 40px auto;
    padding: 0 20px;
}

/* Form */
.scrivomail-form {
    background: #ffffff;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.scrivomail-form-header {
    text-align: center;
    margin-bottom: 30px;
}

.scrivomail-form-header h2 {
    margin: 0 0 10px 0;
    font-size: 28px;
    color: #1a1a1a;
    font-weight: 600;
}

.scrivomail-form-header p {
    margin: 0;
    color: #666;
    font-size: 16px;
}

/* Form Groups */
.scrivomail-form-group {
    margin-bottom: 24px;
}

.scrivomail-form-row-2col {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.scrivomail-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
    font-size: 14px;
}

.scrivomail-form-group label .required {
    color: #e53935;
}

/* Inputs */
.scrivomail-form input[type="text"],
.scrivomail-form input[type="email"],
.scrivomail-form input[type="password"] {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box;
}

.scrivomail-form input:focus {
    outline: none;
    border-color: #4A90D9;
    box-shadow: 0 0 0 3px rgba(74, 144, 217, 0.1);
}

.scrivomail-form input.error {
    border-color: #e53935;
}

.scrivomail-form input.success {
    border-color: #43a047;
}

/* Email Input with Domain */
.scrivomail-email-input {
    display: flex;
    align-items: center;
}

.scrivomail-email-input input {
    border-radius: 8px 0 0 8px;
    border-right: none;
    flex: 1;
}

.scrivomail-email-domain {
    background: #f5f5f5;
    border: 2px solid #e0e0e0;
    border-left: none;
    border-radius: 0 8px 8px 0;
    padding: 14px 16px;
    font-size: 16px;
    color: #666;
    white-space: nowrap;
}

/* Password Input */
.scrivomail-password-input {
    position: relative;
}

.scrivomail-password-input input {
    padding-right: 50px;
}

.scrivomail-toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #666;
    padding: 4px;
}

.scrivomail-toggle-password:hover {
    color: #333;
}

/* Username Status */
.scrivomail-username-status {
    margin-top: 8px;
    font-size: 14px;
    min-height: 20px;
}

.scrivomail-username-status.checking {
    color: #666;
}

.scrivomail-username-status.available {
    color: #43a047;
}

.scrivomail-username-status.taken,
.scrivomail-username-status.invalid {
    color: #e53935;
}

/* Password Strength */
.scrivomail-password-strength {
    margin-top: 8px;
    height: 4px;
    border-radius: 2px;
    background: #e0e0e0;
    overflow: hidden;
}

.scrivomail-password-strength .bar {
    height: 100%;
    transition: width 0.3s, background-color 0.3s;
}

.scrivomail-password-strength.weak .bar {
    width: 25%;
    background: #e53935;
}

.scrivomail-password-strength.fair .bar {
    width: 50%;
    background: #fb8c00;
}

.scrivomail-password-strength.good .bar {
    width: 75%;
    background: #fdd835;
}

.scrivomail-password-strength.strong .bar {
    width: 100%;
    background: #43a047;
}

/* Help Text */
.scrivomail-help {
    display: block;
    margin-top: 6px;
    font-size: 13px;
    color: #888;
}

/* Checkbox */
.scrivomail-checkbox-group {
    margin-top: 20px;
}

.scrivomail-checkbox {
    display: flex;
    align-items: flex-start;
    cursor: pointer;
}

.scrivomail-checkbox input[type="checkbox"] {
    width: 20px;
    height: 20px;
    margin-right: 12px;
    flex-shrink: 0;
    margin-top: 2px;
}

.scrivomail-checkbox span {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

.scrivomail-checkbox a {
    color: #4A90D9;
    text-decoration: none;
}

.scrivomail-checkbox a:hover {
    text-decoration: underline;
}

/* Submit Button */
.scrivomail-submit-btn {
    width: 100%;
    padding: 16px 24px;
    background: linear-gradient(135deg, #4A90D9 0%, #357ABD 100%);
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    text-decoration: none;
}

.scrivomail-submit-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(74, 144, 217, 0.3);
}

.scrivomail-submit-btn:active {
    transform: translateY(0);
}

.scrivomail-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* Spinner */
.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-radius: 50%;
    border-top-color: #fff;
    animation: spin 0.8s linear infinite;
}

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

/* Messages */
.scrivomail-message {
    padding: 16px;
    border-radius: 8px;
    margin-top: 20px;
    font-size: 14px;
    line-height: 1.5;
}

.scrivomail-message.scrivomail-success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

.scrivomail-message.scrivomail-error {
    background: #ffebee;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

.scrivomail-message.scrivomail-info {
    background: #e3f2fd;
    color: #1565c0;
    border: 1px solid #90caf9;
}

/* Form Footer */
.scrivomail-form-footer {
    text-align: center;
    margin-top: 24px;
    padding-top: 24px;
    border-top: 1px solid #eee;
}

.scrivomail-form-footer p {
    margin: 8px 0;
    font-size: 14px;
    color: #666;
}

.scrivomail-form-footer a {
    color: #4A90D9;
    text-decoration: none;
}

.scrivomail-form-footer a:hover {
    text-decoration: underline;
}

/* Success Box */
.scrivomail-success-box {
    text-align: center;
    padding: 40px;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.success-icon {
    font-size: 64px;
    margin-bottom: 20px;
}

.scrivomail-success-box h2 {
    margin: 0 0 16px 0;
    color: #2e7d32;
}

.scrivomail-success-box p {
    margin: 0 0 24px 0;
    color: #666;
    font-size: 18px;
}

.created-email {
    font-size: 24px !important;
    color: #4A90D9 !important;
    font-weight: 600;
}

/* Config Table */
.scrivomail-config-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.scrivomail-config-table th,
.scrivomail-config-table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.scrivomail-config-table th {
    background: #f5f5f5;
    font-weight: 600;
    width: 30%;
}

/* Responsive */
@media (max-width: 600px) {
    .scrivomail-form {
        padding: 24px;
    }
    
    .scrivomail-form-row-2col {
        grid-template-columns: 1fr;
    }
    
    .scrivomail-email-input {
        flex-direction: column;
    }
    
    .scrivomail-email-input input {
        border-radius: 8px;
        border-right: 2px solid #e0e0e0;
    }
    
    .scrivomail-email-domain {
        border-radius: 8px;
        border-left: 2px solid #e0e0e0;
        margin-top: 8px;
        text-align: center;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .scrivomail-form {
        background: #1e1e1e;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    }
    
    .scrivomail-form-header h2 {
        color: #ffffff;
    }
    
    .scrivomail-form-header p,
    .scrivomail-help {
        color: #aaa;
    }
    
    .scrivomail-form-group label {
        color: #ddd;
    }
    
    .scrivomail-form input {
        background: #2d2d2d;
        border-color: #444;
        color: #fff;
    }
    
    .scrivomail-email-domain {
        background: #333;
        border-color: #444;
        color: #aaa;
    }
}
