/* Core styles for centered registration pages (email-confirmed, create-password) */
:root {
    /* Primary colors */
    --primary-green: #9ACB48;
    --primary-purple: #5144A1;
    --primary-grey: #CECECE;
    --primary-navy: #5144A1;
    --primary-black: #1A1A1A;

    /* Light colors */
    --light-cream: #F9F9F0;
    --light-lavender: #F0F0F9;
    --light-blue: #E9EFF2;
    --light-gray: #808080;
    --light-white: #FFFFFF;

    /* Font */
    --font-family: 'Inter', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: var(--font-family);
}

body {
    background-color: var(--light-white);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Container styles */
.container {
    width: 100%;
    max-width: 800px;
    margin: 64px auto;
    background: #FFFFFF;
    box-shadow: 0px 0px 10px rgba(0, 0, 0, 0.05);
    padding: 40px 20px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 760px;
    justify-content: center;
}

/* Logo styles */
.logo-container {
    margin-bottom: 40px;
    width: 200px;
    text-align: center;
}

.logo-container img {
    max-width: 100%;
    height: auto;
}

/* Typography styles */
.message {
    font-family: 'Inter', sans-serif;
    font-style: normal;
    font-weight: 400;
    font-size: 16px;
    line-height: 28px;
    text-align: center;
    color: #1A1A1A;
    margin-bottom: 20px;
    width: 100%;
}

.heading {
    font-family: 'Inter', sans-serif;
    font-style: normal;
    font-weight: 700;
    font-size: 42px;
    line-height: 50px;
    text-align: center;
    color: #4D5E80;
    margin: 0 0 40px 0;
    width: 100%;
    max-width: 430px;
}

/* Form styles */
.form-content {
    width: 100%;
    max-width: 487px;
    margin-bottom: 30px;
}

.input-container, .form-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 20px;
    width: 100%;
}

.input-label, .form-label {
    font-family: 'Inter', sans-serif;
    font-style: normal;
    font-weight: 400;
    font-size: 14px;
    line-height: 21px;
    color: #1A1A1A;
    margin-bottom: 6px;
    text-align: left;
}

.input-field, .form-input, .form-select {
    width: 100%;
    height: 52px;
    background: #FFFFFF;
    border: 1px solid #CCCCCC;
    border-radius: 6px;
    padding: 8px 12px;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    color: #333333;
    margin-bottom: 5px;
    box-shadow: 0px 0px 4px 2px rgba(0, 0, 0, 0.1);
}

.form-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%23C3CAD9' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
}

.input-field:focus, .form-input:focus, .form-select:focus {
    outline: none;
    border-color: #5144A1;
}

/* Password input container with toggle button */
.password-input-container {
    position: relative;
}

.password-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.password-input-wrapper .input-field {
    padding-right: 50px; /* Make room for the toggle button */
}

.password-input-wrapper .password-toggle-btn {
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #999999;
    transition: color 0.2s ease;
    z-index: 2;
}

.password-input-wrapper .password-toggle-btn:hover {
    color: #5144A1;
}

.password-input-wrapper .password-toggle-btn:focus {
    outline: 2px solid #5144A1;
    outline-offset: 2px;
    border-radius: 4px;
}

.password-input-wrapper .password-icon {
    width: 20px;
    height: 20px;
}

/* Mobile responsive adjustments for password toggle */
@media (max-width: 768px) {
    .password-input-wrapper .input-field {
        padding-right: 55px; /* More space for larger touch target */
    }

    .password-input-wrapper .password-toggle-btn {
        right: 12px;
        padding: 10px; /* Larger touch target for mobile */
        width: 44px; /* Minimum touch target size */
        height: 44px;
    }
}

@media (max-width: 480px) {
    .password-input-wrapper .input-field {
        padding-right: 50px;
    }

    .password-input-wrapper .password-toggle-btn {
        right: 10px;
        width: 40px;
        height: 40px;
        padding: 8px;
    }
}

.input-field.error, .form-input.is-invalid, .form-select.is-invalid {
    border: 1px solid #d9534f !important;
}

/* Profile picture styles */
.profile-picture-container {
    margin-top: 20px;
    margin-bottom: 20px;
}

.profile-picture-label {
    font-family: 'Inter', sans-serif;
    font-style: normal;
    font-weight: 400;
    font-size: 14px;
    line-height: 21px;
    color: #1A1A1A;
    margin-bottom: 6px;
    text-align: left;
}

.profile-picture {
    width: 100px;
    height: 100px;
    background: rgba(136, 51, 255, 0.1);
    border-radius: 4px;
    overflow: hidden;
    margin-bottom: 10px;
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    border: 1px dashed #CCCCCC;
}

.profile-picture::before {
    content: '\1F464'; /* Unicode character for user icon */
    font-size: 40px;
    color: #CCCCCC;
    display: flex;
    justify-content: center;
    align-items: center;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(136, 51, 255, 0.1);
}

.profile-picture img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    position: relative;
    z-index: 1;
}

input[type="file"] {
    display: none;
}

/* Button styles */
.button-container {
    width: 100%;
    max-width: 460px;
    display: flex;
    justify-content: center;
    margin-top: 10px;
}

.btn {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    padding: 8px 16px;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    font-family: 'Inter', sans-serif;
    font-style: normal;
    font-weight: 700;
    font-size: 16px;
    line-height: 20px;
    text-align: center;
    text-decoration: none;
    height: 44px;
}

.btn-primary {
    background: #5144A1;
    color: #FFFFFF;
    width: 100%;
}

.btn-primary:hover {
    background-color: var(--primary-purple);
}

.btn-outline {
    background-color: transparent;
    color: #5144A1;
    border: 1px solid #5144A1;
    border-radius: 8px;
    padding: 12px 24px;
    width: 142px;
    height: 38px;
    font-weight: 700;
    font-size: 14px;
    line-height: 14px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.btn-outline:hover {
    background-color: var(--light-lavender);
}

.btn-wide {
    width: 100%;
}

/* Error message */
.error-message {
    color: #d9534f;
    font-size: 14px;
    margin-top: 5px;
    display: none;
}

.error {
    color: #d9534f;
    font-size: 12px;
    margin-top: 5px;
    display: block;
}

.success {
    color: #10B981;
    font-size: 14px;
    margin-bottom: 20px;
    text-align: center;
    display: block;
    padding: 12px;
    background-color: #F0FDF4;
    border: 1px solid #BBF7D0;
    border-radius: 6px;
}

/* Modal styles */
.overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 999;
    display: none;
}

.modal {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: white;
    padding: 24px;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 1000;
    width: 90%;
    max-width: 320px;
    display: none;
}

.modal h3 {
    margin-top: 0;
    color: #333333;
    font-size: 16px;
    margin-bottom: 12px;
}

.modal p {
    margin-bottom: 8px;
    font-size: 14px;
}

.modal ul {
    padding-left: 20px;
    margin-bottom: 16px;
    font-size: 14px;
    line-height: 1.4;
}

.modal ul li {
    margin-bottom: 4px;
}

.modal button {
    background-color: #5144A1;
    color: white !important;
    border: none;
    padding: 8px 16px;
    border-radius: 4px;
    cursor: pointer;
    float: right;
    font-weight: 500;
    font-size: 14px;
}

/* Loading overlay */
.loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    display: none;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #5144A1;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

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

/* Responsive styles */
@media (max-width: 840px) {
    .container {
        margin: 20px auto;
        width: 95%;
        min-height: auto;
        padding: 40px 20px;
    }

    .heading {
        font-size: 32px;
        line-height: 40px;
    }
}

@media (max-width: 480px) {
    .button-container,
    .form-content {
        max-width: 100%;
    }

    .logo-container {
        width: 150px;
    }
}
