/* Profile Form - BEM Style */

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* Removed deprecated .profile-container wrappers */

/* Block: Profile Form */
.profile-form {
    width: 100%;
    padding: 30px 25px;
    background: white;
    border: 1px solid #e3e6ea !important;
    border-radius: 8px;
    margin-top: 50px;
    margin-bottom: 50px;
}

.profile-form__title {
    text-align: center;
    color: #333;
    margin-bottom: 20px;
    font-size: 28px;
    font-weight: 600;
}

.profile-form__fieldset {
    border: none;
}

/* Account info section */
.profile-form__account-info {
    background-color: #f8f9fa;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 25px;
    border: 1px solid #dee2e6;
}

.profile-form__account-text {
    margin: 0;
    font-size: 14px;
    color: #495057;
    text-align: center;
}

.profile-form__account-text strong {
    color: #066AAF;
    font-weight: 600;
}

/* Form groups */
.profile-form__group {
    margin-bottom: 20px;
    display: block !important;
    border: none !important;
}

.profile-form__label {
    display: block;
    margin-bottom: 8px;
    color: #495057;
    font-weight: 500;
    font-size: 14px;
    text-align: left;
    position: relative;
    background: transparent !important;
    padding: 0 !important;
}

.profile-form__input-wrapper {
    width: 100%;
}

/* Input with button group (for email + OTP send) */
.profile-form__input-button-group {
    display: flex;
    gap: 8px;
}
.profile-form__input-button-group input {
    flex: 1;
}

.profile-form__submit-wrapper {
    width: 100%;
    position: relative;
}

.profile-form__password-wrapper {
    width: 100%;
}

.profile-form__logout-wrapper {
    width: 100%;
}

/* Form controls */
.profile-form__input {
    display: block;
    width: 100%;
    padding: 10px 12px;
    font-size: 14px;
    line-height: 1.5;
    color: #495057;
    background-color: #fff;
    background-clip: padding-box;
    border: 1px solid #ced4da;
    border-radius: 4px;
    transition: border-color 0.15s ease-in-out;
    height: auto;
    max-width: 100%;
}

.profile-form__input:focus {
    color: #495057;
    background-color: #fff;
    border-color: #80bdff;
    outline: 0;
}

.profile-form__input--optional {
    /* Optional input styling if needed */
}

.profile-form__input--otp {
    flex: 1;
}

.profile-form__input:disabled,
.profile-form__input[readonly] {
    background-color: #e9ecef;
    opacity: 1;
}

/* Buttons */
.profile-form__button {
    display: inline-block;
    font-weight: 400;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    user-select: none;
    border: 1px solid transparent;
    padding: 10px 16px;
    font-size: 14px;
    line-height: 1.5;
    border-radius: 4px;
    transition: all 0.15s ease-in-out;
    cursor: pointer;
    text-decoration: none;
}

.profile-form__button:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.profile-form__button--primary {
    color: #fff;
    background-color: #066AAF;
    border-color: #066AAF;
}

.profile-form__button--primary:hover:not(:disabled) {
    background-color: #055C92;
    border-color: #055C92;
}

.profile-form__button--secondary {
    color: #fff;
    background-color: #6c757d;
    border-color: #6c757d;
}

.profile-form__button--secondary:hover:not(:disabled) {
    background-color: #5a6268;
    border-color: #545b62;
}

.profile-form__button--outline {
    color: #dc3545;
    background-color: transparent;
    border-color: #dc3545;
}

.profile-form__button--outline:hover:not(:disabled) {
    color: #fff;
    background-color: #dc3545;
    border-color: #dc3545;
}

.profile-form__button--full {
    display: block;
    width: 100%;
}

/* OTP area (like register) */
.profile-form__otp-area {
    margin-top: 12px;
    padding: 14px;
    background: #f8f9fa;
    border-radius: 6px;
    border: 1px solid #dee2e6;
}
.profile-form__otp-row {
    display: flex;
    gap: 8px;
    margin-bottom: 8px;
}
.profile-form__otp-meta {
    font-size: 13px;
    color: #6c757d;
}
.profile-form__otp-timer {
    font-weight: 500;
}
.profile-form__otp-verified {
    color: #155724;
    text-align: center;
    font-weight: bold;
}

/* Inline error text for email/OTP */
.profile-form__error {
    display: inline-block;
    margin-left: 8px;
    color: #dc3545;
    font-weight: 400;
    font-size: 13px;
}
.profile-form__error--hide {
    display: none !important;
}

/* Success message */
.profile-form__success-message {
    margin-top: 12px;
    padding: 12px;
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    border-radius: 4px;
    text-align: center;
    font-weight: 500;
}

.profile-form__success-message--hide {
    display: none !important;
}

/* Field validation states */
.profile-form__input--success {
    border-color: #28a745;
}

.profile-form__input--error {
    border-color: #dc3545;
}

.profile-form__validation-feedback {
    width: 100%;
    margin-top: 0.25rem;
    font-size: 0.875rem;
}

.profile-form__validation-feedback--valid {
    color: #28a745;
}

.profile-form__validation-feedback--invalid {
    color: #dc3545;
}

/* Loading state */
.profile-form__loading {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-radius: 50%;
    border-top: 2px solid #066AAF;
    animation: profile-form-spin 1s linear infinite;
    margin-left: 10px;
    vertical-align: middle;
}

@keyframes profile-form-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Utility classes */
.hide {
    display: none !important;
}

/* Responsive adjustments */
@media (max-width: 767px) {
    .profile-form {
        padding: 20px 15px;
        margin-top: 30px;
        margin-bottom: 30px;
    }
    
    .profile-form__title {
        font-size: 24px;
    }
    
    .profile-form__account-info {
        padding: 12px;
    }
}

/* Backwards compatibility for existing sm-profile wrapper */
.sm-profile .profile-form {
    /* Styles will apply whether wrapped in sm-profile or not */
}
